1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Fix excessive GC rooting

rb_vm_add_root_module() is enough to make sure the object become a GC
root.
This commit is contained in:
Alan Wu 2020-11-06 19:01:49 -05:00
parent 6817f4c6b1
commit 6778ba48fd
Notes: git 2020-11-10 06:09:05 +09:00

View file

@ -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;