Project

General

Profile

Feature #8684 ยป patch.diff

Glass_saga (Masaki Matsushita), 07/25/2013 08:40 PM

View differences:

gc.c
4453 4453
    int old = dont_gc;
4454 4454

  
4455 4455
    dont_gc = TRUE;
4456
    return old ? Qtrue : Qfalse;
4456

  
4457
    if (rb_block_given_p())
4458
	return rb_ensure(rb_yield, Qnil, rb_gc_enable, Qnil);
4459
    else
4460
	return old ? Qtrue : Qfalse;
4457 4461
}
4458 4462

  
4459 4463
void
test/ruby/test_gc.rb
48 48
    GC.enable
49 49
  end
50 50

  
51
  def test_disable_with_block
52
    GC.enable
53
    GC.disable do
54
      assert_equal(true, GC.disable)
55
    end
56
    assert_equal(false, GC.enable)
57
  ensure
58
    GC.enable
59
  end
60

  
51 61
  def test_count
52 62
    c = GC.count
53 63
    GC.start