summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gc.c b/gc.c
index 1440dbeea4..182ad42e0a 100644
--- a/gc.c
+++ b/gc.c
@@ -6158,8 +6158,8 @@ gc_start(rb_objspace_t *objspace, const int full_mark, const int immediate_mark,
int do_full_mark = full_mark;
objspace->flags.immediate_sweep = immediate_sweep;
- if (!heap_allocated_pages) return FALSE; /* heap is not ready */
- if (!ready_to_gc(objspace)) return TRUE; /* GC is not allowed */
+ if (!heap_allocated_pages) return FALSE; /* heap is not ready */
+ if (reason != GPR_FLAG_METHOD && !ready_to_gc(objspace)) return TRUE; /* GC is not allowed */
if (RGENGC_CHECK_MODE) {
assert(objspace->flags.stat == gc_stat_none);