summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2023-06-29 15:25:31 -0400
committerPeter Zhu <peter@peterzhu.ca>2023-06-29 19:07:26 -0400
commitd3ff43852b22f5463d22aab390ef340d9ebe4b06 (patch)
treec99959edf8a7a0b0ea445f090208433a4f8ba386 /test/ruby
parent1272865a8ee948816ee9f5484f8adba8e26f45e2 (diff)
Fix memory leak in Hash#replace
Hash#replace can leak memory if the receiver has an ST table.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/8001
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_hash.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/ruby/test_hash.rb b/test/ruby/test_hash.rb
index e66beef29f..9121f3539e 100644
--- a/test/ruby/test_hash.rb
+++ b/test/ruby/test_hash.rb
@@ -1325,7 +1325,7 @@ class TestHash < Test::Unit::TestCase
end
def test_replace_memory_leak
- assert_no_memory_leak([], "#{<<-"begin;"}", "#{<<-'end;'}")
+ assert_no_memory_leak([], "#{<<-"begin;"}", "#{<<-'end;'}", rss: true)
h = ("aa".."zz").each_with_index.to_h
10_000.times {h.dup}
begin;