summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-26 07:22:43 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-26 07:22:43 +0000
commit4190cdddbbe85c3097b30eda2a528cc9482bdfa4 (patch)
tree190dc9a5dd4d7df16a8b4cbe0831ac834aaf9f92 /gc.c
parent165ebcb4675f7fc5cd536da586835a6cf46e0da3 (diff)
* 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
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/gc.c b/gc.c
index 34c06a8941..98e2298e0c 100644
--- a/gc.c
+++ b/gc.c
@@ -4766,15 +4766,7 @@ vm_xrealloc(rb_objspace_t *objspace, void *ptr, size_t size)
oldsize = ((size_t *)ptr)[0];
#endif
- 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();
- }
- }
+ TRY_WITH_GC(mem = realloc(ptr, size));
ATOMIC_SIZE_ADD(malloc_increase, size);
#if CALC_EXACT_MALLOC_SIZE