[前][次][番号順一覧][スレッド一覧]

ruby-changes:66662

From: Nobuyoshi <ko1@a...>
Date: Fri, 2 Jul 2021 10:49:39 +0900 (JST)
Subject: [ruby-changes:66662] 8ebb5e23eb (master): Keep GC disabled until VM bootstrap has done [Bug #17583]

https://git.ruby-lang.org/ruby.git/commit/?id=8ebb5e23eb

From 8ebb5e23ebc5f1675e3479b9a29f124dc458226b Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Tue, 9 Mar 2021 16:29:50 +0900
Subject: Keep GC disabled until VM bootstrap has done [Bug #17583]

---
 test/ruby/test_thread.rb | 4 +++-
 vm.c                     | 4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/test/ruby/test_thread.rb b/test/ruby/test_thread.rb
index a75d42b..19a3529 100644
--- a/test/ruby/test_thread.rb
+++ b/test/ruby/test_thread.rb
@@ -1146,7 +1146,9 @@ q.pop https://github.com/ruby/ruby/blob/trunk/test/ruby/test_thread.rb#L1146
     env = {}
     env['RUBY_THREAD_VM_STACK_SIZE'] = vm_stack_size.to_s if vm_stack_size
     env['RUBY_THREAD_MACHINE_STACK_SIZE'] = machine_stack_size.to_s if machine_stack_size
-    out, = EnvUtil.invoke_ruby([env, '-e', script], '', true, true)
+    out, err, status = EnvUtil.invoke_ruby([env, '-e', script], '', true, true)
+    assert_not_predicate(status, :signaled?, err)
+
     use_length ? out.length : out
   end
 
diff --git a/vm.c b/vm.c
index 3963d67..b120216 100644
--- a/vm.c
+++ b/vm.c
@@ -3669,6 +3669,8 @@ Init_VM(void) https://github.com/ruby/ruby/blob/trunk/vm.c#L3669
 	 * The Binding of the top level scope
 	 */
 	rb_define_global_const("TOPLEVEL_BINDING", rb_binding_new());
+
+        rb_objspace_gc_enable(vm->objspace);
     }
     vm_init_redefined_flag();
 
@@ -3734,8 +3736,6 @@ Init_vm_objects(void) https://github.com/ruby/ruby/blob/trunk/vm.c#L3736
     vm->mark_object_ary = rb_ary_tmp_new(128);
     vm->loading_table = st_init_strtable();
     vm->frozen_strings = st_init_table_with_size(&rb_fstring_hash_type, 10000);
-
-    rb_objspace_gc_enable(vm->objspace);
 }
 
 /* top self */
-- 
cgit v1.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]