patch_seq_make_closure

Function patch_seq_make_closure 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn patch_seq_make_closure( fn_ptr: u64, env: *mut [Value], ) -> Value
Expand description

Create a closure value from a function pointer and environment

Takes ownership of the environment (converts raw pointer to Arc). Arc enables TCO: no cleanup needed after tail calls.

ยงSafety

  • fn_ptr must be a valid function pointer (will be transmuted when called)
  • env must be a valid pointer from create_env, fully populated via env_set
  • env ownership is transferred to the Closure value