ExecuteFunc

Type Alias ExecuteFunc 

Source
pub type ExecuteFunc<F, CTX> = unsafe fn(pre_compute: &[u8], instret: &mut u64, pc: &mut u32, arg: u64, exec_state: &mut VmExecState<F, GuestMemory, CTX>);
Expand description

Function pointer for interpreter execution with function signature (pre_compute, instret, pc, arg, exec_state). The pre_compute: &[u8] is a pre-computed buffer of data corresponding to a single instruction. The contents of pre_compute are determined from the program code as specified by the Executor and MeteredExecutor traits. arg is a runtime constant that we want to keep in register:

  • For pure execution it is instret_end
  • For metered cost execution it is the max_execution_cost
  • For metered execution it is segment_check_insns