mirror of
https://github.com/ruby/ruby.git
synced 2025-09-17 17:43:59 +02:00
merge revision(s) c42261059d
: [Backport #19901]
[Bug #19901] fix leak in module clone Co-authored-by: Peter Zhu <peter@peterzhu.ca> --- class.c | 1 + test/ruby/test_module.rb | 12 ++++++++++++ 2 files changed, 13 insertions(+)
This commit is contained in:
parent
97b7070ebd
commit
a191cf5617
3 changed files with 14 additions and 1 deletions
|
@ -3318,6 +3318,18 @@ class TestModule < Test::Unit::TestCase
|
|||
CODE
|
||||
end
|
||||
|
||||
def test_module_clone_memory_leak
|
||||
# [Bug #19901]
|
||||
assert_no_memory_leak([], <<~PREP, <<~CODE, rss: true)
|
||||
code = proc do
|
||||
Module.new.clone
|
||||
end
|
||||
1_000.times(&code)
|
||||
PREP
|
||||
1_000_000.times(&code)
|
||||
CODE
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def assert_top_method_is_private(method)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue