Skip to content
Merged
Prev Previous commit
Next Next commit
Fix gc.get_threshold to return actual gen2 threshold value
  • Loading branch information
youknowone committed Mar 10, 2026
commit 980c73127361a831e472eedf6f9d2e86eafeff74
5 changes: 2 additions & 3 deletions crates/vm/src/stdlib/gc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,14 @@ mod gc {
}

/// Return the current collection thresholds as a tuple.
/// The third value is always 0.
#[pyfunction]
fn get_threshold(vm: &VirtualMachine) -> PyObjectRef {
let (t0, t1, _t2) = gc_state::gc_state().get_threshold();
let (t0, t1, t2) = gc_state::gc_state().get_threshold();
vm.ctx
.new_tuple(vec![
vm.ctx.new_int(t0).into(),
vm.ctx.new_int(t1).into(),
vm.ctx.new_int(0).into(),
vm.ctx.new_int(t2).into(),
])
.into()
}
Expand Down