diff options
| author | NARUSE, Yui <nurse@users.noreply.github.com> | 2024-03-22 09:25:36 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-22 00:25:36 +0000 |
| commit | a24802e8fd7e05077256605885c82ffd8221bc94 (patch) | |
| tree | 7dbe2c8d0fb866dd8a21435c23b842e0996ca7df /include/ruby/ruby.h | |
| parent | eb7cb164cffc86b63d2e2528c73e160c33b7a2e5 (diff) | |
merge revision(s) c7ce2f537f96ab2cf2f5fc2982d6147866ff5340: [Backport #20304] (#10311)
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 'include/ruby/ruby.h')
0 files changed, 0 insertions, 0 deletions
