зеркало из https://github.com/github/ruby.git
* 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
This commit is contained in:
Родитель
d553c518d5
Коммит
a6ca9f9fce
|
@ -1,3 +1,12 @@
|
|||
Fri Nov 22 10:35:57 2013 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* 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.
|
||||
|
||||
Fri Nov 22 09:42:35 2013 Zachary Scott <e@zzak.io>
|
||||
|
||||
* test/digest/test_digest.rb: Reverse order of assert_equal
|
||||
|
|
10
gc.c
10
gc.c
|
@ -5715,6 +5715,16 @@ ruby_mimmalloc(size_t size)
|
|||
return mem;
|
||||
}
|
||||
|
||||
void
|
||||
ruby_mimfree(void *ptr)
|
||||
{
|
||||
size_t *mem = (size_t *)ptr;
|
||||
#if CALC_EXACT_MALLOC_SIZE
|
||||
mem = mem - 1;
|
||||
#endif
|
||||
free(mem);
|
||||
}
|
||||
|
||||
#if CALC_EXACT_MALLOC_SIZE
|
||||
/*
|
||||
* call-seq:
|
||||
|
|
|
@ -428,6 +428,7 @@ NORETURN(void rb_syserr_fail_path_in(const char *func_name, int err, VALUE path)
|
|||
/* gc.c */
|
||||
void Init_heap(void);
|
||||
void *ruby_mimmalloc(size_t size);
|
||||
void ruby_mimfree(void *ptr);
|
||||
void rb_objspace_set_event_hook(const rb_event_flag_t event);
|
||||
void rb_gc_writebarrier_remember_promoted(VALUE obj);
|
||||
|
||||
|
|
7
vm.c
7
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");
|
||||
|
|
Загрузка…
Ссылка в новой задаче