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

Method charge_steps

compiler/src/modules/vm/dispatch.rs:790–796  ·  view source on GitHub ↗
(&mut self, n: usize)

Source from the content-addressed store, hash-verified

788 /* Charge `n` units at once; for native builtins (sort, materialise) whose cost scales with input size. */
789 #[inline]
790 pub(crate) fn charge_steps(&mut self, n: usize) -> Result<(), VmErr> {
791 if !self.sandbox_off {
792 if self.budget < n { self.budget = 0; return Err(cold_budget()); }
793 self.budget -= n;
794 }
795 Ok(())
796 }
797
798 #[inline(never)]
799 fn exec_for_iter(&mut self, op: u16, ip: &mut usize, n: usize, chunk: &SSAChunk, slots: &mut [Val]) -> Result<(), VmErr> {

Callers 10

add_valsMethod · 0.80
mul_valsMethod · 0.80
exec_fastMethod · 0.80
str_to_char_valsMethod · 0.80
handle_containerMethod · 0.80
display_opMethod · 0.80
repr_opMethod · 0.80
resume_coroutineMethod · 0.80
top_loopMethod · 0.80
extract_iterMethod · 0.80

Calls 1

cold_budgetFunction · 0.85

Tested by

no test coverage detected