diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-09-27 09:36:48 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-09-27 09:36:48 +0000 |
commit | 2c0d74b7085edba6557b32a3f48ef8a03d194eb4 (patch) | |
tree | db8826f3a41edc7b685119479d870114291ca59b /test/ruby/test_gc.rb | |
parent | a31ff891a17f0dcf8c070b882fe89be89837e7c5 (diff) | |
download | ruby-2c0d74b7085edba6557b32a3f48ef8a03d194eb4.tar.gz |
* gc.c: add two GC tuning environment variables.
RUBY_GC_MALLOC_LIMIT_MAX and RUBY_GC_MALLOC_LIMIT_GROWTH_FACTOR.
See r43067 for details.
* gc.c (rb_gc_set_params): refactoring. And change verbose notation.
Mostly duplicated functions get_envparam_int/double is not cool.
Please rewrite it.
* test/ruby/test_gc.rb: fix a test for this change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_gc.rb')
-rw-r--r-- | test/ruby/test_gc.rb | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/test/ruby/test_gc.rb b/test/ruby/test_gc.rb index b1e52fc58e..53fd107747 100644 --- a/test/ruby/test_gc.rb +++ b/test/ruby/test_gc.rb @@ -113,13 +113,23 @@ class TestGc < Test::Unit::TestCase assert_in_out_err([env, "-e", "exit"], "", [], [], "[ruby-core:39795]") assert_in_out_err([env, "-W0", "-e", "exit"], "", [], [], "[ruby-core:39795]") assert_in_out_err([env, "-W1", "-e", "exit"], "", [], [], "[ruby-core:39795]") - assert_in_out_err([env, "-w", "-e", "exit"], "", [], /heap_min_slots=100000/, "[ruby-core:39795]") + assert_in_out_err([env, "-w", "-e", "exit"], "", [], /HEAP_MIN_SLOTS=100000/, "[ruby-core:39795]") env = { "RUBY_HEAP_SLOTS_GROWTH_FACTOR" => "2.0" } assert_normal_exit("exit", "", :child_env => env) - assert_in_out_err([env, "-w", "-e", "exit"], "", [], /heap_slots_growth_factor=2.0/, "") + assert_in_out_err([env, "-w", "-e", "exit"], "", [], /HEAP_SLOTS_GROWTH_FACTOR=2.0/, "") + + env = { + "RUBY_GC_MALLOC_LIMIT" => "60000000", + "RUBY_GC_MALLOC_LIMIT_MAX" => "160000000", + "RUBY_GC_MALLOC_LIMIT_GROWTH_FACTOR" => "2.0" + } + assert_normal_exit("exit", "", :child_env => env) + assert_in_out_err([env, "-w", "-e", "exit"], "", [], /RUBY_GC_MALLOC_LIMIT=6000000/, "") + assert_in_out_err([env, "-w", "-e", "exit"], "", [], /RUBY_GC_MALLOC_LIMIT_MAX=16000000/, "") + assert_in_out_err([env, "-w", "-e", "exit"], "", [], /RUBY_GC_MALLOC_LIMIT_GROWTH_FACTOR=2.0/, "") end def test_profiler_enabled |