summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
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 6c9a054db1..c3e62fdf35 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;