summaryrefslogtreecommitdiff
path: root/test/ruby/test_lambda.rb
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2024-01-03 11:15:44 -0500
committerPeter Zhu <peter@peterzhu.ca>2024-01-03 13:31:43 -0500
commitc7ce2f537f96ab2cf2f5fc2982d6147866ff5340 (patch)
tree544090b833c9bffe518a5c3b9e16f53d3466e2ef /test/ruby/test_lambda.rb
parenta25329e0dab2a3ada395b1e4e0254a15cd498de2 (diff)
Fix memory leak in setting encodings
There is a memory leak in Encoding.default_external= and Encoding.default_internal= because the duplicated name is not freed when overwriting. 10.times do 1_000_000.times do Encoding.default_internal = nil end puts `ps -o rss= -p #{$$}` end Before: 25664 41504 57360 73232 89168 105056 120944 136816 152720 168576 After: 9648 9648 9648 9680 9680 9680 9680 9680 9680 9680
Diffstat (limited to 'test/ruby/test_lambda.rb')
0 files changed, 0 insertions, 0 deletions