Feature #8684 ยป patch.diff
| gc.c | ||
|---|---|---|
|
int old = dont_gc;
|
||
|
dont_gc = TRUE;
|
||
|
return old ? Qtrue : Qfalse;
|
||
|
if (rb_block_given_p())
|
||
|
return rb_ensure(rb_yield, Qnil, rb_gc_enable, Qnil);
|
||
|
else
|
||
|
return old ? Qtrue : Qfalse;
|
||
|
}
|
||
|
void
|
||
| test/ruby/test_gc.rb | ||
|---|---|---|
|
GC.enable
|
||
|
end
|
||
|
def test_disable_with_block
|
||
|
GC.enable
|
||
|
GC.disable do
|
||
|
assert_equal(true, GC.disable)
|
||
|
end
|
||
|
assert_equal(false, GC.enable)
|
||
|
ensure
|
||
|
GC.enable
|
||
|
end
|
||
|
def test_count
|
||
|
c = GC.count
|
||
|
GC.start
|
||