Keep GC disabled until VM bootstrap has done [Bug #17583]

This commit is contained in:
Nobuyoshi Nakada 2021-03-09 16:29:50 +09:00 коммит произвёл Jeremy Evans
Родитель 1862d961a9
Коммит 8ebb5e23eb
2 изменённых файлов: 5 добавлений и 3 удалений

Просмотреть файл

@ -1146,7 +1146,9 @@ q.pop
env = {} env = {}
env['RUBY_THREAD_VM_STACK_SIZE'] = vm_stack_size.to_s if vm_stack_size 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 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 use_length ? out.length : out
end end

4
vm.c
Просмотреть файл

@ -3669,6 +3669,8 @@ Init_VM(void)
* The Binding of the top level scope * The Binding of the top level scope
*/ */
rb_define_global_const("TOPLEVEL_BINDING", rb_binding_new()); rb_define_global_const("TOPLEVEL_BINDING", rb_binding_new());
rb_objspace_gc_enable(vm->objspace);
} }
vm_init_redefined_flag(); vm_init_redefined_flag();
@ -3734,8 +3736,6 @@ Init_vm_objects(void)
vm->mark_object_ary = rb_ary_tmp_new(128); vm->mark_object_ary = rb_ary_tmp_new(128);
vm->loading_table = st_init_strtable(); vm->loading_table = st_init_strtable();
vm->frozen_strings = st_init_table_with_size(&rb_fstring_hash_type, 10000); vm->frozen_strings = st_init_table_with_size(&rb_fstring_hash_type, 10000);
rb_objspace_gc_enable(vm->objspace);
} }
/* top self */ /* top self */