diff options
author | nari <nari@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-03-18 15:30:02 +0000 |
---|---|---|
committer | nari <nari@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-03-18 15:30:02 +0000 |
commit | 80329d3a66bf007d85a35c624d6514b0ddc814ca (patch) | |
tree | 8f2f150ac7c01424c4165889576bc02f9611a5cc /test/ruby/test_gc.rb | |
parent | 1bc93a15912ab418bd54c0c064a47c557798eae9 (diff) | |
download | ruby-80329d3a66bf007d85a35c624d6514b0ddc814ca.tar.gz |
* gc.c: Improve accuracy of objspace_live_num() and
allocated/freed counters. patched by tmm1(Aman Gupta).
[Bug #8092] [ruby-core:53392]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39812 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_gc.rb')
-rw-r--r-- | test/ruby/test_gc.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_gc.rb b/test/ruby/test_gc.rb index 90c47875ee..b1e52fc58e 100644 --- a/test/ruby/test_gc.rb +++ b/test/ruby/test_gc.rb @@ -64,6 +64,12 @@ class TestGc < Test::Unit::TestCase assert_equal(arg, res) assert_equal(false, res.empty?) assert_kind_of(Integer, res[:count]) + + stat, count = {}, {} + GC.start + GC.stat(stat) + ObjectSpace.count_objects(count) + assert_equal(count[:TOTAL]-count[:FREE], stat[:heap_live_num]) end def test_singleton_method |