From e7915d6d7042c7945195289d882aa91e35dc9404 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Mon, 19 Dec 2022 11:44:00 -0500 Subject: Fix misfire of compaction read barrier gc_compact_move incorrectly returns false when destination heap is full after sweeping. It returns false even if destination heap is different than source heap (returning false means that the source heap has finished compacting). This causes the source page to get locked, which causes a read barrier fire when we try to compact the source heap again. --- gc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gc.c') diff --git a/gc.c b/gc.c index 785235046b..c77c2ac04b 100644 --- a/gc.c +++ b/gc.c @@ -8519,7 +8519,7 @@ gc_compact_move(rb_objspace_t *objspace, rb_heap_t *heap, rb_size_pool_t *size_p dheap->sweeping_page = ccan_list_next(&dheap->pages, dheap->sweeping_page, page_node); if (gc_compact_heap_cursors_met_p(dheap)) { - return false; + return dheap != heap; } } -- cgit v1.2.3