summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2020-08-26 16:16:17 (GMT)
committerKoichi Sasada <ko1@atdot.net>2020-09-20 14:13:47 (GMT)
commitb6d599d76ec85422bea16b63f105985cf08e04bd (patch)
tree4353ca4d504b7673f66b769ca5a1cc0b25aff9c4
parentbe2efb118f73e73d35ba1473fd08a1550ff07fde (diff)
Update heap_pages_himem after freeing pages
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3461
-rw-r--r--gc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gc.c b/gc.c
index 7f48f1d..aa63cdb 100644
--- a/gc.c
+++ b/gc.c
@@ -1769,6 +1769,12 @@ heap_pages_free_unused_pages(rb_objspace_t *objspace)
j++;
}
}
+
+ struct heap_page *hipage = heap_pages_sorted[heap_allocated_pages - 1];
+ RVALUE *himem = hipage->start + hipage->total_slots;
+ GC_ASSERT(himem <= heap_pages_himem);
+ heap_pages_himem = himem;
+
GC_ASSERT(j == heap_allocated_pages);
}
}