diff options
author | tmm1 <tmm1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-12-06 05:11:51 +0000 |
---|---|---|
committer | tmm1 <tmm1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-12-06 05:11:51 +0000 |
commit | 470c9d844b11f003d0118def80a08fb2437fd0d0 (patch) | |
tree | 5e18b9864130df2d6af5c4aaedc2f2513423c33c /test | |
parent | c52eadeb77908afb629ae74e20d734015d63c82a (diff) | |
download | ruby-470c9d844b11f003d0118def80a08fb2437fd0d0.tar.gz |
gc.c: add minor marking and lazy sweeping options to GC.start
* gc.c (gc_start_internal): GC.start() now accepts two optional
keyword arguments. These can be used to disable full_mark (minor
mark only) or disable immediate_sweep (use lazy sweep). These new
options are useful for benchmarking GC behavior, or performing minor
GC out-of-band.
* test/ruby/test_gc.rb (class TestGc): tests for new options.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44027 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_gc.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/ruby/test_gc.rb b/test/ruby/test_gc.rb index 76104fedfe..f45983156e 100644 --- a/test/ruby/test_gc.rb +++ b/test/ruby/test_gc.rb @@ -48,6 +48,22 @@ class TestGc < Test::Unit::TestCase GC.enable end + def test_start_full_mark + GC.start(full_mark: false) + assert_nil GC.latest_gc_info(:major_by) + + GC.start(full_mark: true) + assert_not_nil GC.latest_gc_info(:major_by) + end + + def test_start_immediate_sweep + GC.start(immediate_sweep: false) + assert_equal false, GC.latest_gc_info(:immediate_sweep) + + GC.start(immediate_sweep: true) + assert_equal true, GC.latest_gc_info(:immediate_sweep) + end + def test_count c = GC.count GC.start |