aboutsummaryrefslogtreecommitdiffstats
path: root/gc.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-19 12:57:20 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-19 12:57:20 +0000
commit121b6e064a1b167dddbdc271d503ff96e7deb83b (patch)
tree2c7dcf6e8b6edaba9b31debc032bf299ba223cb8 /gc.c
parentd5d997fa11cd6d6642904593f21a466cccf17710 (diff)
downloadruby-121b6e064a1b167dddbdc271d503ff96e7deb83b.tar.gz
* gc.c (gc_start): force to invoke GC by GC.start
even if it is GC.disable'd. * test/ruby/test_gc.rb: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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);