ruby-changes:59968
From: Nobuyoshi <ko1@a...>
Date: Sun, 9 Feb 2020 17:18:33 +0900 (JST)
Subject: [ruby-changes:59968] 0f05b234fb (master): Disable GC until VM objects get initialized [Bug #16616]
https://git.ruby-lang.org/ruby.git/commit/?id=0f05b234fb From 0f05b234fba2d961f1740c094a83f9831c15b210 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Sun, 9 Feb 2020 16:41:56 +0900 Subject: Disable GC until VM objects get initialized [Bug #16616] diff --git a/gc.c b/gc.c index 779b4b0..e7dce9e 100644 --- a/gc.c +++ b/gc.c @@ -1623,6 +1623,7 @@ rb_objspace_alloc(void) https://github.com/ruby/ruby/blob/trunk/gc.c#L1623 malloc_limit = gc_params.malloc_limit_min; list_head_init(&objspace->eden_heap.pages); list_head_init(&objspace->tomb_heap.pages); + dont_gc = TRUE; return objspace; } diff --git a/test/ruby/test_thread.rb b/test/ruby/test_thread.rb index f8127d8..30a3cc7 100644 --- a/test/ruby/test_thread.rb +++ b/test/ruby/test_thread.rb @@ -1150,6 +1150,7 @@ q.pop https://github.com/ruby/ruby/blob/trunk/test/ruby/test_thread.rb#L1150 "0 thread_machine_stack_size") assert_operator(h_default[:thread_machine_stack_size], :<=, h_large[:thread_machine_stack_size], "large thread_machine_stack_size") + assert_equal("ok", invoke_rec('print :ok', 1024 * 1024 * 100, nil, false)) end def test_vm_machine_stack_size diff --git a/vm.c b/vm.c index f2f160b..8c7abb3 100644 --- a/vm.c +++ b/vm.c @@ -3345,6 +3345,8 @@ Init_vm_objects(void) https://github.com/ruby/ruby/blob/trunk/vm.c#L3345 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 v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/