Skip to content

Commit c3f43ec

Browse files
committed
Fixes after big rebase
1 parent 735b0bf commit c3f43ec

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

gc/default/default.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1485,8 +1485,6 @@ total_final_slots_count(rb_objspace_t *objspace)
14851485
#define GC_INCREMENTAL_SWEEP_BYTES (2048 * RVALUE_SLOT_SIZE)
14861486
#define GC_INCREMENTAL_SWEEP_POOL_BYTES (1024 * RVALUE_SLOT_SIZE)
14871487
// TODO get rid of next 2 defines
1488-
#define GC_INCREMENTAL_SWEEP_SLOT_COUNT 2048
1489-
#define GC_INCREMENTAL_SWEEP_POOL_SLOT_COUNT 1024
14901488
#define is_lazy_sweeping(objspace) ((objspace)->during_lazy_sweeping != FALSE)
14911489
/* In lazy sweeping or the previous incremental marking finished and did not yield a free page. */
14921490
#define needs_continue_sweeping(objspace, heap) \
@@ -5677,8 +5675,10 @@ gc_sweep_continue(rb_objspace_t *objspace, rb_heap_t *sweep_heap)
56775675
else {
56785676
for (int i = 0; i < HEAP_COUNT; i++) {
56795677
rb_heap_t *heap = &heaps[i];
5678+
size_t sweep_budget = GC_INCREMENTAL_SWEEP_BYTES / heap->slot_size;
5679+
size_t pool_budget = GC_INCREMENTAL_SWEEP_POOL_BYTES / heap->slot_size;
56805680
heap->background_sweep_steps = heap->foreground_sweep_steps;
5681-
if (heap->pre_swept_slots_deferred >= (GC_INCREMENTAL_SWEEP_SLOT_COUNT + GC_INCREMENTAL_SWEEP_POOL_SLOT_COUNT)) {
5681+
if (heap->pre_swept_slots_deferred >= (sweep_budget + pool_budget)) {
56825682
heap->skip_sweep_continue = true;
56835683
}
56845684
else {

0 commit comments

Comments
 (0)