Skip to content

Commit 4f6e539

Browse files
committed
wip: revert changes to gc_should_collect()
These are not strictly needed, simplify PR.
1 parent 4f99de6 commit 4f6e539

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

Python/gc_free_threading.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1599,15 +1599,11 @@ gc_should_collect(GCState *gcstate)
15991599
if (count <= threshold || threshold == 0 || !gcstate->enabled) {
16001600
return false;
16011601
}
1602-
#if 1 // disable to force more frequent collections
16031602
// Avoid quadratic behavior by scaling threshold to the number of live
16041603
// objects. A few tests rely on immediate scheduling of the GC so we ignore
16051604
// the scaled threshold if generations[1].threshold is set to zero.
1606-
if (count < gcstate->long_lived_total / 4 && gcstate->old[0].threshold != 0) {
1607-
return false;
1608-
}
1609-
#endif
1610-
return true;
1605+
return (count > gcstate->long_lived_total / 4 ||
1606+
gcstate->old[0].threshold == 0);
16111607
}
16121608

16131609
static void

0 commit comments

Comments
 (0)