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:
parent
6817f4c6b1
commit
6778ba48fd
Notes:
git
2020-11-10 06:09:05 +09:00
1 changed files with 0 additions and 2 deletions
2
class.c
2
class.c
|
@ -834,7 +834,6 @@ rb_define_class_id_under(VALUE outer, ID id, VALUE super)
|
||||||
rb_const_set(outer, id, klass);
|
rb_const_set(outer, id, klass);
|
||||||
rb_class_inherited(super, klass);
|
rb_class_inherited(super, klass);
|
||||||
rb_vm_add_root_module(klass);
|
rb_vm_add_root_module(klass);
|
||||||
rb_gc_register_mark_object(klass);
|
|
||||||
|
|
||||||
return klass;
|
return klass;
|
||||||
}
|
}
|
||||||
|
@ -872,7 +871,6 @@ rb_define_module(const char *name)
|
||||||
}
|
}
|
||||||
module = rb_define_module_id(id);
|
module = rb_define_module_id(id);
|
||||||
rb_vm_add_root_module(module);
|
rb_vm_add_root_module(module);
|
||||||
rb_gc_register_mark_object(module);
|
|
||||||
rb_const_set(rb_cObject, id, module);
|
rb_const_set(rb_cObject, id, module);
|
||||||
|
|
||||||
return module;
|
return module;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue