1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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/trunk@1639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
knu 2001-07-20 15:20:25 +00:00
parent f50be7cba7
commit 33c679ba9a
2 changed files with 8 additions and 1 deletions

View file

@ -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++.

3
gc.c
View file

@ -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;