summaryrefslogtreecommitdiffstats
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
commitb384ac5f656c7ae2ff9ca27b41763250cd51dfb1 (patch)
treee2794a921f30efcb80b971720e009b9a76628c1a
parente8dd9d4c14e96184599254b41f194830f97c71dd (diff)
downloadruby-b384ac5f656c7ae2ff9ca27b41763250cd51dfb1.tar.gz
ruby-b384ac5f656c7ae2ff9ca27b41763250cd51dfb1.tar.xz
ruby-b384ac5f656c7ae2ff9ca27b41763250cd51dfb1.zip
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@1639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--gc.c3
2 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 0ca81b54d..3d55961f5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Fri Jul 20 22:55:01 2001 Akinori MUSHA <knu@iDaemons.org>
+
+ * gc.c (ruby_xrealloc): fix a dangling bug which led memory
+ reallocation to fail even though the second try after a GC
+ succeeds.
+
Tue Jul 17 11:44:40 2001 Usaku Nakamura <usa@osb.att.ne.jp>
* ruby.h: enable volatile directive with VC++.
diff --git a/gc.c b/gc.c
index 6c9a054db..c3e62fdf3 100644
--- a/gc.c
+++ b/gc.c
@@ -134,11 +134,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;