Skip to content

Commit

Permalink
Disable GC until VM objects get initialized [Bug #16616]
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu committed Feb 9, 2020
1 parent aeaf0dc commit 0f05b23
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions gc.c
Expand Up @@ -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;
}
Expand Down
1 change: 1 addition & 0 deletions test/ruby/test_thread.rb
Expand Up @@ -1150,6 +1150,7 @@ def test_stack_size
"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
Expand Down
2 changes: 2 additions & 0 deletions vm.c
Expand Up @@ -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 */
Expand Down

0 comments on commit 0f05b23

Please sign in to comment.