File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 {
You can’t perform that action at this time.
0 commit comments