MCPcopy Create free account
hub / github.com/explodingcamera/tinywasm / charge_call_fuel

Method charge_call_fuel

crates/tinywasm/src/interpreter/executor.rs:41–50  ·  view source on GitHub ↗
(&mut self, total_fuel_cost: u32)

Source from the content-addressed store, hash-verified

39
40 #[inline(always)]
41 fn charge_call_fuel(&mut self, total_fuel_cost: u32) {
42 if BUDGETED {
43 let extra = match self.store.engine.config().fuel_policy {
44 FuelPolicy::PerInstruction => 0,
45 FuelPolicy::Weighted => total_fuel_cost.saturating_sub(1),
46 };
47
48 self.store.execution_fuel = self.store.execution_fuel.saturating_sub(extra);
49 }
50 }
51
52 #[inline(always)]
53 fn exec_binop_32(&self, op: BinOp, lhs: Value32, rhs: Value32) -> Value32 {

Callers 5

exec_call_directMethod · 0.80
exec_call_selfMethod · 0.80
exec_return_call_selfMethod · 0.80
exec_call_indirectMethod · 0.80

Calls 1

configMethod · 0.80

Tested by

no test coverage detected