1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Disable GC until VM objects get initialized [Bug #16616]

This commit is contained in:
Nobuyoshi Nakada 2020-02-09 16:41:56 +09:00
parent aeaf0dc555
commit 0f05b234fb
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60
3 changed files with 4 additions and 0 deletions

1
gc.c
View file

@ -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;
}

View file

@ -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

2
vm.c
View file

@ -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 */