summaryrefslogtreecommitdiff
path: root/vm.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-22 01:38:08 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-22 01:38:08 +0000
commita6ca9f9fce7bcef4a1c04384bb834b5ee0013b16 (patch)
tree7200856f12f9e06f29dbc75fdb51b8c7dbf6cfe0 /vm.c
parentd553c518d525851d8d4a4f8db63e3027e4a5d72d (diff)
* vm.c (ruby_vm_destruct): do not use ruby_xfree() after freeing
objspace. * gc.c (ruby_mimfree): added. It is similar to ruby_mimmalloc(). * internal.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm.c')
-rw-r--r--vm.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/vm.c b/vm.c
index 77a77ea..5acdf2b 100644
--- a/vm.c
+++ b/vm.c
@@ -1654,14 +1654,15 @@ ruby_vm_destruct(rb_vm_t *vm)
st_free_table(vm->living_threads);
vm->living_threads = 0;
}
+ ruby_vm_run_at_exit_hooks(vm);
+ rb_vm_gvl_destroy(vm);
#if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
if (objspace) {
rb_objspace_free(objspace);
}
#endif
- ruby_vm_run_at_exit_hooks(vm);
- rb_vm_gvl_destroy(vm);
- ruby_xfree(vm);
+ /* after freeing objspace, you *can't* use ruby_xfree() */
+ ruby_mimfree(vm);
ruby_current_vm = 0;
}
RUBY_FREE_LEAVE("vm");