ruby-changes:13915
From: nobu <ko1@a...>
Date: Wed, 11 Nov 2009 18:20:56 +0900 (JST)
Subject: [ruby-changes:13915] Ruby:r25719 (mvm): * gc.c (rb_objspace_free): finalizer should have been done already.
nobu 2009-11-11 18:20:40 +0900 (Wed, 11 Nov 2009) New Revision: 25719 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=25719 Log: * gc.c (rb_objspace_free): finalizer should have been done already. * vm.c (rb_vm_free): VM does not belong to any object spaces. * vm.c (ruby_make_bare_vm): thread belongs to its VM object space. Modified files: branches/mvm/.merged-trunk-revision branches/mvm/ChangeLog branches/mvm/gc.c branches/mvm/vm.c Index: mvm/ChangeLog =================================================================== --- mvm/ChangeLog (revision 25718) +++ mvm/ChangeLog (revision 25719) @@ -1,3 +1,11 @@ +Wed Nov 11 18:20:36 2009 Nobuyoshi Nakada <nobu@r...> + + * gc.c (rb_objspace_free): finalizer should have been done already. + + * vm.c (rb_vm_free): VM does not belong to any object spaces. + + * vm.c (ruby_make_bare_vm): thread belongs to its VM object space. + Wed Nov 11 12:54:02 2009 Nobuyoshi Nakada <nobu@r...> * hash.c (ruby_setenv): use ruby_strdup(). Index: mvm/gc.c =================================================================== --- mvm/gc.c (revision 25718) +++ mvm/gc.c (revision 25719) @@ -386,7 +386,6 @@ void rb_objspace_free(rb_objspace_t *objspace) { - rb_objspace_call_finalizer(objspace); if (objspace->profile.record) { free(objspace->profile.record); objspace->profile.record = 0; Index: mvm/.merged-trunk-revision =================================================================== --- mvm/.merged-trunk-revision (revision 25718) +++ mvm/.merged-trunk-revision (revision 25719) @@ -1 +1 @@ -25717 +25718 Index: mvm/vm.c =================================================================== --- mvm/vm.c (revision 25718) +++ mvm/vm.c (revision 25719) @@ -1501,12 +1501,12 @@ } ruby_native_thread_unlock(&vm->global_vm_lock); ruby_native_thread_lock_destroy(&vm->global_vm_lock); - ruby_xfree(vm); #if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE if (objspace) { rb_objspace_free(objspace); } #endif + free(vm); } RUBY_FREE_LEAVE("vm"); } @@ -2135,18 +2135,18 @@ { /* VM bootstrap: phase 1 */ rb_vm_t *vm = malloc(sizeof(*vm)); - rb_thread_t *th = malloc(sizeof(*th)); + rb_thread_t *th; - if (!vm || !th) { - if (vm) free(vm); - if (th) free(th); + if (!vm) { return 0; } + + vm_init2(vm); + + th = rb_objspace_xmalloc(vm->objspace, sizeof(*th)); MEMZERO(th, rb_thread_t, 1); - th->vm = vm; rb_thread_set_current_raw(th); - vm_init2(vm); vm->main_thread = th; th_init(th, 0); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/