MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / charge_step

Method charge_step

compiler/src/modules/vm/dispatch.rs:780–786  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

778 /* Charge one unit against the op budget; for native loops (custom-iterator drain, generator collect) that bypass the dispatch back-edge counter. */
779 #[inline]
780 pub(crate) fn charge_step(&mut self) -> Result<(), VmErr> {
781 if !self.sandbox_off {
782 if self.budget == 0 { return Err(cold_budget()); }
783 self.budget -= 1;
784 }
785 Ok(())
786 }
787
788 /* Charge `n` units at once; for native builtins (sort, materialise) whose cost scales with input size. */
789 #[inline]

Callers 7

contains_opMethod · 0.80
iter_to_vec_opMethod · 0.80
exec_callMethod · 0.80
call_iterMethod · 0.80
call_allMethod · 0.80
call_anyMethod · 0.80
call_listMethod · 0.80

Calls 1

cold_budgetFunction · 0.85

Tested by

no test coverage detected