summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authorAaron Patterson <tenderlove@ruby-lang.org>2020-11-05 12:28:50 -0800
committerAaron Patterson <tenderlove@ruby-lang.org>2020-11-05 12:28:50 -0800
commit6d17c9fa5d6c578dd53e431c3fb4f288cce6248e (patch)
treed0381013635f9e680631b8518da9e4ad9ab104af /gc.c
parentd8da5c198348eac3d3d7a3e13dfb8a9351ed07ae (diff)
gc_rest can change the total pages, so we need to do that first
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gc.c b/gc.c
index a5f99e5e3d..a41160abe6 100644
--- a/gc.c
+++ b/gc.c
@@ -8520,8 +8520,6 @@ gc_sort_heap_by_empty_slots(rb_objspace_t *objspace)
struct heap_page *page = 0, **page_list = malloc(size);
size_t i = 0;
- gc_rest(objspace);
-
list_for_each(&heap_eden->pages, page, page_node) {
page_list[i++] = page;
assert(page != NULL);
@@ -9256,6 +9254,8 @@ gc_verify_compaction_references(rb_execution_context_t *ec, VALUE self, VALUE do
RB_VM_LOCK_ENTER();
{
+ gc_rest(objspace);
+
if (RTEST(double_heap)) {
heap_add_pages(objspace, heap_eden, heap_allocated_pages);
}