summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-07-20 15:20:25 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-07-20 15:20:25 +0000
commit207bce362dc6d194a4abc4d174f21c42bcaf0a4b (patch)
treeb2a897c853d9d990a5e9e5ad1184de7574c830d0 /gc.c
parentcc97021a4507f632cfba5be1b66aa9ed46c00eeb (diff)
* gc.c (ruby_xrealloc): fix a dangling bug which led memory
reallocation to fail even though the second try after a GC succeeds. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@1639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gc.c b/gc.c
index db06b221bf..3ebdb2b8d9 100644
--- a/gc.c
+++ b/gc.c
@@ -138,11 +138,12 @@ ruby_xrealloc(ptr, size)
if (!mem) {
rb_gc();
RUBY_CRITICAL(mem = realloc(ptr, size));
- if (!mem)
+ if (!mem) {
if (size >= 50 * 1024 * 1024) {
rb_raise(rb_eNoMemError, "tried to re-allocate too big memory");
}
mem_error("failed to allocate memory(realloc)");
+ }
}
return mem;