summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2023-08-30 16:49:32 -0400
committerPeter Zhu <peter@peterzhu.ca>2023-08-30 19:37:11 -0400
commit0aa404b9573d028d87072f40ecb9b86dc161b7ef (patch)
treea076ccf82c7c58b4835d036101d8ce1a8616096c /test/ruby
parent4aa98b2760944b04b827d6ba4037548a93ef94ff (diff)
Change heap init environment variable names
This commit changes RUBY_GC_HEAP_INIT_SIZE_{40,80,160,320,640}_SLOTS to RUBY_GC_HEAP_{0,1,2,3,4}_INIT_SLOTS. This is easier to use because the user does not need to determine the slot sizes (which can vary between 32 and 64 bit systems). They now just use the heap names (`GC.stat_heap.keys`).
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/8335
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_gc.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/test/ruby/test_gc.rb b/test/ruby/test_gc.rb
index 8fc511331e..3967ed54bc 100644
--- a/test/ruby/test_gc.rb
+++ b/test/ruby/test_gc.rb
@@ -377,17 +377,17 @@ class TestGc < Test::Unit::TestCase
}
assert_in_out_err([env, "-W0", "-e", "exit"], "", [], [])
assert_in_out_err([env, "-W:deprecated", "-e", "exit"], "", [],
- /The environment variable RUBY_GC_HEAP_INIT_SLOTS is deprecated; use environment variables RUBY_GC_HEAP_INIT_SIZE_%d_SLOTS instead/)
+ /The environment variable RUBY_GC_HEAP_INIT_SLOTS is deprecated; use environment variables RUBY_GC_HEAP_%d_INIT_SLOTS instead/)
env = {}
- GC.stat_heap.each do |_, s|
- env["RUBY_GC_HEAP_INIT_SIZE_#{s[:slot_size]}_SLOTS"] = "200000"
+ GC.stat_heap.keys.each do |heap|
+ env["RUBY_GC_HEAP_#{heap}_INIT_SLOTS"] = "200000"
end
assert_normal_exit("exit", "", :child_env => env)
env = {}
- GC.stat_heap.each do |_, s|
- env["RUBY_GC_HEAP_INIT_SIZE_#{s[:slot_size]}_SLOTS"] = "0"
+ GC.stat_heap.keys.each do |heap|
+ env["RUBY_GC_HEAP_#{heap}_INIT_SLOTS"] = "0"
end
assert_normal_exit("exit", "", :child_env => env)
@@ -456,8 +456,8 @@ class TestGc < Test::Unit::TestCase
env = {}
# Make the heap big enough to ensure the heap never needs to grow.
sizes = GC.stat_heap.keys.reverse.map { |i| (i + 1) * 100_000 }
- GC.stat_heap.each do |i, s|
- env["RUBY_GC_HEAP_INIT_SIZE_#{s[:slot_size]}_SLOTS"] = sizes[i].to_s
+ GC.stat_heap.keys.each do |heap|
+ env["RUBY_GC_HEAP_#{heap}_INIT_SLOTS"] = sizes[heap].to_s
end
assert_separately([env, "-W0"], __FILE__, __LINE__, <<~RUBY)
SIZES = #{sizes}