diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-11-22 01:38:08 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-11-22 01:38:08 +0000 |
commit | a6ca9f9fce7bcef4a1c04384bb834b5ee0013b16 (patch) | |
tree | 7200856f12f9e06f29dbc75fdb51b8c7dbf6cfe0 /vm.c | |
parent | d553c518d525851d8d4a4f8db63e3027e4a5d72d (diff) | |
download | ruby-a6ca9f9fce7bcef4a1c04384bb834b5ee0013b16.tar.gz |
* 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.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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"); |