Skip to main content

patch_seq_env_push_value

Function patch_seq_env_push_value 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn patch_seq_env_push_value( stack: Stack, env_data: *const Value, env_len: usize, index: i32, ) -> Stack
Expand description

Push any value from the closure environment onto the stack.

This is the generic capture-push function for types that don’t have specialized getters (Variant, Map, Union, Symbol, Channel). It clones the Value from the env and pushes it directly, avoiding passing Value by value through the FFI boundary (which crashes on Linux for some types).

§Safety

  • stack must be a valid stack pointer
  • env_data must be a valid pointer to a Value array
  • env_len must match the actual array length
  • index must be in bounds [0, env_len)