patch_seq_env_get_int

Function patch_seq_env_get_int 

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

Get an Int value from the closure environment

This is a type-specific helper that avoids passing large Value enums through LLVM IR. Returns primitive i64 instead of Value to avoid FFI issues with by-value enum passing.

§Safety

  • env_data must be a valid pointer to an array of Values
  • env_len must match the actual array length
  • index must be in bounds [0, env_len)
  • The value at index must be Value::Int

§FFI Notes

This function is ONLY called from LLVM-generated code, not from external C code. The signature is safe for LLVM IR but would be undefined behavior if called from C with incorrect assumptions about type layout.