ruby-changes:63561
From: Alan <ko1@a...>
Date: Tue, 10 Nov 2020 06:09:01 +0900 (JST)
Subject: [ruby-changes:63561] 6778ba48fd (master): Fix excessive GC rooting
https://git.ruby-lang.org/ruby.git/commit/?id=6778ba48fd From 6778ba48fddcab1bca56b9bccc7ea5f9583baba8 Mon Sep 17 00:00:00 2001 From: Alan Wu <XrXr@u...> Date: Fri, 6 Nov 2020 19:01:49 -0500 Subject: Fix excessive GC rooting rb_vm_add_root_module() is enough to make sure the object become a GC root. 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) https://github.com/ruby/ruby/blob/trunk/class.c#L834 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) https://github.com/ruby/ruby/blob/trunk/class.c#L871 } 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; -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/