summaryrefslogtreecommitdiff
path: root/class.c
diff options
context:
space:
mode:
authorAlan Wu <XrXr@users.noreply.github.com>2020-11-06 19:01:49 -0500
committerAlan Wu <XrXr@users.noreply.github.com>2020-11-09 16:08:36 -0500
commit6778ba48fddcab1bca56b9bccc7ea5f9583baba8 (patch)
tree1e344d08f3f5da4d21a5b1d4d74ce5145a89f237 /class.c
parent6817f4c6b1ab58d74bab989de984bd1d84be233c (diff)
Fix excessive GC rooting
rb_vm_add_root_module() is enough to make sure the object become a GC root.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3741
Diffstat (limited to 'class.c')
-rw-r--r--class.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/class.c b/class.c
index 13885d9..4b8130d 100644
--- a/class.c
+++ b/class.c
@@ -834,7 +834,6 @@ rb_define_class_id_under(VALUE outer, ID id, VALUE super)
rb_const_set(outer, id, klass);
rb_class_inherited(super, klass);
rb_vm_add_root_module(klass);
- rb_gc_register_mark_object(klass);
return klass;
}
@@ -872,7 +871,6 @@ rb_define_module(const char *name)
}
module = rb_define_module_id(id);
rb_vm_add_root_module(module);
- rb_gc_register_mark_object(module);
rb_const_set(rb_cObject, id, module);
return module;