Skip to content

Commit

Permalink
Incrementally mark even if we have free pages
Browse files Browse the repository at this point in the history
We move all pooled pages to free pages at the start of incremental
marking, so we shouldn't run incremental marking only when we have run
out of free pages. This causes incremental marking to always complete
in a single step.
  • Loading branch information
peterzhu2118 committed Aug 16, 2023
1 parent 52837fc commit e1c6d2e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2347,7 +2347,7 @@ gc_continue(rb_objspace_t *objspace, rb_size_pool_t *size_pool, rb_heap_t *heap)
gc_enter(objspace, gc_enter_event_continue, &lock_lev);

/* Continue marking if in incremental marking. */
if (heap->free_pages == NULL && is_incremental_marking(objspace)) {
if (is_incremental_marking(objspace)) {
if (gc_marks_continue(objspace, size_pool, heap)) {
gc_sweep(objspace);
}
Expand Down

0 comments on commit e1c6d2e

Please sign in to comment.