Skip to main content

SimulationKernelFn

Type Alias SimulationKernelFn 

Source
pub type SimulationKernelFn = unsafe extern "C" fn(cursor_index: usize, series_ptrs: *const *const f64, state_ptr: *mut u8) -> i32;
Expand description

Function pointer type for simulation kernel functions (single series).

This is the “fused step” ABI that enables >10M ticks/sec by:

  • Bypassing JITContext setup overhead
  • Using direct pointer arithmetic for data access
  • Avoiding all allocations in the hot loop

§Arguments

  • cursor_index - Current position in the series (0-based)
  • series_ptrs - Pointer to array of column pointers (*const *const f64)
  • state_ptr - Pointer to TypedObject state (*mut u8)

§Returns

  • 0 = continue execution
  • 1 = signal generated (written to state)
  • negative = error

§Safety

The caller must ensure:

  • cursor_index is within bounds
  • series_ptrs points to valid column pointer array
  • state_ptr points to valid TypedObject with correct schema