Struct wasm_instrument::gas_metering::mutable_global::Injector
source · pub struct Injector {
pub global_name: &'static str,
}
Expand description
Injects a mutable global variable and a local function to the module to track current gas left.
The function is called in every metering block. In case of falling out of gas, the global is
set to the sentinel value U64::MAX
and unreachable
instruction is called. The execution
engine should take care of getting the current global value and setting it back in order to
sync the gas left value during an execution.
Fields§
§global_name: &'static str
The export name of the gas tracking global.