summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authorAaron Patterson <tenderlove@ruby-lang.org>2019-07-10 11:12:28 -0500
committerAaron Patterson <tenderlove@ruby-lang.org>2019-07-10 11:12:28 -0500
commit12762b76cba8ac4623a6c16e1fe60efafa3b7d1c (patch)
tree317677a4c2774ad768e19dc6c66f2accf64bdd54 /gc.c
parentf91879a7b548284c93743168acfd11e3d2aeefac (diff)
Don't manipulate GC flags directly
We need to disable the GC around compaction (for now) because object id book keeping can cause malloc to happen and that can trigger GC.
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 2b7b039830..2268dd78b7 100644
--- a/gc.c
+++ b/gc.c
@@ -8217,9 +8217,9 @@ gc_compact(rb_objspace_t *objspace, int use_toward_empty, int use_double_pages,
/* pin objects referenced by maybe pointers */
rb_gc();
/* compact */
- during_gc = TRUE;
+ rb_gc_disable();
gc_compact_after_gc(objspace, use_toward_empty, use_double_pages, TRUE);
- during_gc = FALSE;
+ rb_gc_enable();
}
objspace->flags.during_compacting = FALSE;
return gc_compact_stats(objspace);