aboutsummaryrefslogtreecommitdiffstats
path: root/gc.c
diff options
context:
space:
mode:
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gc.c b/gc.c
index 5f67bdec29..104dac2b5e 100644
--- a/gc.c
+++ b/gc.c
@@ -1209,6 +1209,9 @@ static void heap_page_free(rb_objspace_t *objspace, struct heap_page *page);
void
rb_objspace_free(rb_objspace_t *objspace)
{
+ if (is_lazy_sweeping(heap_eden))
+ rb_bug("lazy sweeping underway when freeing object space");
+
if (objspace->profile.records) {
free(objspace->profile.records);
objspace->profile.records = 0;
@@ -2620,6 +2623,12 @@ rb_objspace_call_finalizer(rb_objspace_t *objspace)
st_free_table(finalizer_table);
finalizer_table = 0;
ATOMIC_SET(finalizing, 0);
+
+ /*
+ * finish any lazy sweeps that may have been started
+ * when finalizing the objects in the heap
+ */
+ gc_rest(objspace);
}
static inline int