diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-02-09 16:41:56 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-02-09 17:15:55 +0900 |
commit | 0f05b234fba2d961f1740c094a83f9831c15b210 (patch) | |
tree | 0283939c8605553098467cc4e8982ced2408e57e | |
parent | aeaf0dc55595b8a5bfdd92007fb85ef13855c632 (diff) |
Disable GC until VM objects get initialized [Bug #16616]
-rw-r--r-- | gc.c | 1 | ||||
-rw-r--r-- | test/ruby/test_thread.rb | 1 | ||||
-rw-r--r-- | vm.c | 2 |
3 files changed, 4 insertions, 0 deletions
@@ -1623,6 +1623,7 @@ rb_objspace_alloc(void) 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 f8127d8786..30a3cc784e 100644 --- a/test/ruby/test_thread.rb +++ b/test/ruby/test_thread.rb @@ -1150,6 +1150,7 @@ q.pop "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 @@ -3345,6 +3345,8 @@ Init_vm_objects(void) 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 */ |