summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gc.c b/gc.c
index d7d7c26..0db6354 100644
--- a/gc.c
+++ b/gc.c
@@ -901,7 +901,10 @@ rb_gc()
#endif
if (dont_gc || during_gc || rb_prohibit_interrupt || ruby_in_compile) {
- add_heap();
+ if (!freelist || malloc_memories > GC_MALLOC_LIMIT) {
+ malloc_memories = 0;
+ add_heap();
+ }
return;
}