mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* gc.c (vm_xrealloc): use TRY_WITH_GC().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43049 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
165ebcb467
commit
4190cdddbb
1 changed files with 1 additions and 9 deletions
10
gc.c
10
gc.c
|
@ -4766,15 +4766,7 @@ vm_xrealloc(rb_objspace_t *objspace, void *ptr, size_t size)
|
||||||
oldsize = ((size_t *)ptr)[0];
|
oldsize = ((size_t *)ptr)[0];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
mem = realloc(ptr, size);
|
TRY_WITH_GC(mem = realloc(ptr, size));
|
||||||
if (!mem) {
|
|
||||||
if (garbage_collect_with_gvl(objspace, 1, 1, GPR_FLAG_MALLOC)) {
|
|
||||||
mem = realloc(ptr, size);
|
|
||||||
}
|
|
||||||
if (!mem) {
|
|
||||||
ruby_memerror();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ATOMIC_SIZE_ADD(malloc_increase, size);
|
ATOMIC_SIZE_ADD(malloc_increase, size);
|
||||||
|
|
||||||
#if CALC_EXACT_MALLOC_SIZE
|
#if CALC_EXACT_MALLOC_SIZE
|
||||||
|
|
Loading…
Add table
Reference in a new issue