aboutsummaryrefslogtreecommitdiffstats
path: root/gc.c
diff options
context:
space:
mode:
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gc.c b/gc.c
index 635e3ecadf..38bdcfd04b 100644
--- a/gc.c
+++ b/gc.c
@@ -2043,8 +2043,14 @@ gc_prepare_free_objects(rb_objspace_t *objspace)
{
int res;
- if (objspace->flags.dont_lazy_sweep)
- return garbage_collect(objspace);
+ if (objspace->flags.dont_lazy_sweep) {
+ if (heaps_increment(objspace)) {
+ return;
+ }
+ else {
+ return garbage_collect(objspace);
+ }
+ }
if (!ready_to_gc(objspace)) return TRUE;