pub fn xmove(from: &mut LuaState, to: &mut LuaState, n: i32)Expand description
Move the top n values from from’s stack onto to’s stack.
Both threads must share the same GlobalState (i.e. one is a
coroutine the other created via coroutine.create). Calling with
from == to is a no-op. Equivalent to:
args = from.stack[top-n..top].clone();
from.set_top(top - n);
for v in args { to.push(v); }Implemented for the same-GlobalState case (the only one lua-stdlib
uses today). lua-vm callers should prefer this helper over hand-rolling
the snapshot/push dance.