1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* gc.c (gc_profile_clear): realloc profile records if its size is

higher than the threshold, GC_PROFILE_RECORD_DEFAULT_SIZE * 2.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nari 2012-11-21 13:15:10 +00:00
parent 4d03af3d9c
commit fe9fc6df01
3 changed files with 31 additions and 1 deletions

View file

@ -118,4 +118,20 @@ class TestGc < Test::Unit::TestCase
ensure
GC::Profiler.disable
end
def test_profiler_clear
GC::Profiler.enable
GC.start
assert_equal(1, GC::Profiler.raw_data.size)
GC.clear
assert_equal(0, GC::Profiler.raw_data.size)
200.times{ GC.start }
assert_equal(200, GC::Profiler.raw_data.size)
GC.clear
assert_equal(0, GC::Profiler.raw_data.size)
ensure
GC::Profiler.disable
end
end