ruby-changes:33728
From: nobu <ko1@a...>
Date: Sun, 4 May 2014 22:04:41 +0900 (JST)
Subject: [ruby-changes:33728] nobu:r45809 (trunk): vm.c: Init_vm_objects
nobu 2014-05-04 22:04:37 +0900 (Sun, 04 May 2014) New Revision: 45809 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=45809 Log: vm.c: Init_vm_objects * vm.c (Init_vm_objects): initialize VM internal objects, after heap initialized. Modified files: trunk/eval.c trunk/internal.h trunk/vm.c Index: eval.c =================================================================== --- eval.c (revision 45808) +++ eval.c (revision 45809) @@ -51,6 +51,7 @@ ruby_setup(void) https://github.com/ruby/ruby/blob/trunk/eval.c#L51 ruby_init_stack((void *)&state); Init_BareVM(); Init_heap(); + Init_vm_objects(); PUSH_TAG(); if ((state = EXEC_TAG()) == 0) { Index: internal.h =================================================================== --- internal.h (revision 45808) +++ internal.h (revision 45809) @@ -889,6 +889,7 @@ rb_serial_t rb_next_class_serial(void); https://github.com/ruby/ruby/blob/trunk/internal.h#L889 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); Index: vm.c =================================================================== --- vm.c (revision 45808) +++ vm.c (revision 45809) @@ -2726,7 +2726,17 @@ Init_BareVM(void) https://github.com/ruby/ruby/blob/trunk/vm.c#L2726 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) https://github.com/ruby/ruby/blob/trunk/vm.c#L2761 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 * -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/