From bead5396503175b6873d1b4e60bd8c8d2c82b772 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Wed, 16 Aug 2023 08:55:01 -0400 Subject: [PATCH] Incrementally mark even if we have free pages 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. --- gc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gc.c b/gc.c index 0d2a9a4daa..2863240aa6 100644 --- a/gc.c +++ b/gc.c @@ -2392,7 +2392,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); }