File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -1548,14 +1548,15 @@ assess_work_to_do(GCState *gcstate)
1548
1548
* This could be improved by tracking survival rates, but it is still a
1549
1549
* large improvement on the non-marking approach.
1550
1550
*/
1551
- Py_ssize_t scale_factor = gcstate -> old [0 ].threshold ;
1551
+ intptr_t scale_factor = gcstate -> old [0 ].threshold ;
1552
1552
if (scale_factor < 2 ) {
1553
1553
scale_factor = 2 ;
1554
1554
}
1555
- Py_ssize_t new_objects = gcstate -> young .count ;
1556
- Py_ssize_t heap_fraction = gcstate -> heap_size / SCAN_RATE_DIVISOR / scale_factor ;
1557
- if (heap_fraction > new_objects * 2 ) {
1558
- heap_fraction = new_objects * 2 ;
1555
+ intptr_t new_objects = gcstate -> young .count ;
1556
+ intptr_t max_heap_fraction = new_objects * 3 /2 ;
1557
+ intptr_t heap_fraction = gcstate -> heap_size / SCAN_RATE_DIVISOR / scale_factor ;
1558
+ if (heap_fraction > max_heap_fraction ) {
1559
+ heap_fraction = max_heap_fraction ;
1559
1560
}
1560
1561
gcstate -> young .count = 0 ;
1561
1562
return new_objects + heap_fraction ;
You can’t perform that action at this time.
0 commit comments