MCPcopy Index your code
hub / github.com/RustPython/RustPython / get_threshold

Function get_threshold

crates/vm/src/stdlib/gc.rs:84–93  ·  view source on GitHub ↗
(vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

82 /// Return the current collection thresholds as a tuple.
83 #[pyfunction]
84 fn get_threshold(vm: &VirtualMachine) -> PyObjectRef {
85 let (t0, t1, t2) = gc_state::gc_state().get_threshold();
86 vm.ctx
87 .new_tuple(vec![
88 vm.ctx.new_int(t0).into(),
89 vm.ctx.new_int(t1).into(),
90 vm.ctx.new_int(t2).into(),
91 ])
92 .into()
93 }
94
95 /// Set the collection thresholds.
96 #[pyfunction]

Callers

nothing calls this directly

Calls 3

gc_stateFunction · 0.85
get_thresholdMethod · 0.80
new_tupleMethod · 0.45

Tested by

no test coverage detected