Fix heap growth in GC.verify_compaction_references
We should grow by at least gc_params.heap_init_slots, but the previous calculation was incorrect.
This commit is contained in:
parent
1f64301e12
commit
c3dc9fcc70
10
gc.c
10
gc.c
@ -10846,13 +10846,13 @@ gc_verify_compaction_references(rb_execution_context_t *ec, VALUE self, VALUE do
|
|||||||
rb_size_pool_t *size_pool = &size_pools[i];
|
rb_size_pool_t *size_pool = &size_pools[i];
|
||||||
rb_heap_t *heap = SIZE_POOL_EDEN_HEAP(size_pool);
|
rb_heap_t *heap = SIZE_POOL_EDEN_HEAP(size_pool);
|
||||||
|
|
||||||
|
size_t minimum_pages = 0;
|
||||||
if (RTEST(expand_heap)) {
|
if (RTEST(expand_heap)) {
|
||||||
size_t required_pages = growth_slots / size_pool->slot_size;
|
int multiple = size_pool->slot_size / BASE_SLOT_SIZE;
|
||||||
heap_add_pages(objspace, size_pool, heap, MAX(required_pages, heap->total_pages));
|
minimum_pages = growth_slots * multiple / HEAP_PAGE_OBJ_LIMIT;
|
||||||
}
|
|
||||||
else {
|
|
||||||
heap_add_pages(objspace, size_pool, heap, heap->total_pages);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
heap_add_pages(objspace, size_pool, heap, MAX(minimum_pages, heap->total_pages));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user