clone_stack

Function clone_stack 

Source
pub unsafe fn clone_stack(stack: Stack) -> Stack
Expand description

Clone a stack - creates a deep copy of all values

This is used by spawn to pass a copy of the parent’s stack to the child. Returns a new stack with cloned values, or null if input is null.

NOTE: This uses Box allocation instead of pool allocation because the cloned stack will be used by a different strand (different thread context). Thread-local pools are not shared between strands.

§Safety

Stack pointer must be valid (or null for empty stack)