summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authorAaron Patterson <tenderlove@ruby-lang.org>2019-04-22 17:14:36 -0700
committerAaron Patterson <tenderlove@ruby-lang.org>2019-04-22 20:08:01 -0700
commitea520ca9273699fc1c77a71bbeba4b6e06ccfc6c (patch)
tree835783d0d3a7d09ff0f6064056a06e70178928e7 /gc.c
parent660c0716595a8fc942d12317a5c55c038b830e94 (diff)
Prevent rb_define_(class|module) classes from moving
Before this commit, classes and modules would be registered with the VM's `defined_module_hash`. The key was the ID of the class, but that meant that it was possible for hash collisions to occur. The compactor doesn't allow classes in the `defined_module_hash` to move, but if there is a conflict, then it's possible a class would be removed from the hash and not get pined. This commit changes the key / value of the hash just to be the class itself, thus preventing movement.
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gc.c b/gc.c
index f90bdd99bf..9529b2d4a4 100644
--- a/gc.c
+++ b/gc.c
@@ -8159,7 +8159,7 @@ gc_verify_compaction_references(VALUE mod)
heap_eden->using_page = NULL;
gc_verify_internal_consistency(mod);
- rb_gc_enable();
+
/* GC after compaction to eliminate T_MOVED */
rb_gc();