Skip to main content

run_on_js_stack

Function run_on_js_stack 

Source
pub fn run_on_js_stack(f: fn() -> ExitCode) -> ExitCode
Expand description

Run f on a thread with JS_STACK_SIZE of stack, falling back to the calling thread if the reservation is refused (a ulimited or memory-capped environment must still run programs, just at a lower recursion ceiling — host::stack_exhausted measures whatever stack it ends up on).

Takes a plain fn pointer, not a closure: Builder::spawn consumes what it is given and does not hand it back on failure, and a fn is Copy, so the fallback can still call the same entry point.