Skip to content

Commit 3ca4331

Browse files
committed
objspace->sweeping_heap_count == 0 check in heap_prepare
1 parent 18ca368 commit 3ca4331

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

gc/default/default.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2734,7 +2734,8 @@ heap_prepare(rb_objspace_t *objspace, rb_heap_t *heap)
27342734
GC_ASSERT(heap->free_pages == NULL);
27352735

27362736
#if USE_PARALLEL_SWEEP
2737-
if (heap->total_slots < (gc_params.heap_init_bytes / heap->slot_size) && heap_is_sweep_done(objspace, heap)) {
2737+
if (heap->total_slots < (gc_params.heap_init_bytes / heap->slot_size) &&
2738+
(objspace->sweeping_heap_count == 0 || heap_is_sweep_done(objspace, heap))) {
27382739
heap_page_allocate_and_initialize_force(objspace, heap);
27392740
GC_ASSERT(heap->free_pages != NULL);
27402741
return;

0 commit comments

Comments
 (0)