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

vm.c: Init_vm_objects

* vm.c (Init_vm_objects): initialize VM internal objects, after
  heap initialized.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2014-05-04 13:04:37 +00:00
parent fffbcf2867
commit 40c6eaf6d8
3 changed files with 12 additions and 3 deletions

1
eval.c
View file

@ -51,6 +51,7 @@ ruby_setup(void)
ruby_init_stack((void *)&state);
Init_BareVM();
Init_heap();
Init_vm_objects();
PUSH_TAG();
if ((state = EXEC_TAG()) == 0) {

View file

@ -889,6 +889,7 @@ rb_serial_t rb_next_class_serial(void);
VALUE rb_obj_is_thread(VALUE obj);
void rb_vm_mark(void *ptr);
void Init_BareVM(void);
void Init_vm_objects(void);
VALUE rb_vm_top_self(void);
void rb_thread_recycle_stack_release(VALUE *);
void rb_vm_change_state(void);

13
vm.c
View file

@ -2726,7 +2726,17 @@ Init_BareVM(void)
th->vm = vm;
th_init(th, 0);
ruby_thread_init_stack(th);
}
void
Init_vm_objects(void)
{
rb_vm_t *vm = GET_VM();
vm->defined_module_hash = rb_hash_new();
/* initialize mark object array, hash */
vm->mark_object_ary = rb_ary_tmp_new(1);
}
/* top self */
@ -2751,9 +2761,6 @@ Init_top_self(void)
vm->top_self = rb_obj_alloc(rb_cObject);
rb_define_singleton_method(rb_vm_top_self(), "to_s", main_to_s, 0);
rb_define_alias(rb_singleton_class(rb_vm_top_self()), "inspect", "to_s");
/* initialize mark object array, hash */
vm->mark_object_ary = rb_ary_tmp_new(1);
}
VALUE *