diff options
author | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-07-20 15:20:25 +0000 |
---|---|---|
committer | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-07-20 15:20:25 +0000 |
commit | 207bce362dc6d194a4abc4d174f21c42bcaf0a4b (patch) | |
tree | b2a897c853d9d990a5e9e5ad1184de7574c830d0 /gc.c | |
parent | cc97021a4507f632cfba5be1b66aa9ed46c00eeb (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.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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; |