diff options
| author | nagachika <nagachika@ruby-lang.org> | 2023-09-30 13:46:29 +0900 |
|---|---|---|
| committer | nagachika <nagachika@ruby-lang.org> | 2023-09-30 13:46:29 +0900 |
| commit | 97b7070ebd5493de8d3a6a9b0ecc91bef5068d3f (patch) | |
| tree | a6fa7e558dda05efec25cc022d06dc6ac5cdaf21 /test/ruby | |
| parent | 5640baa2f82f528a092d92ceaabeb76c43c098ee (diff) | |
merge revision(s) 8b236e0c66da8f92e9fc33de66cfbc8e4b0c0763: [Backport #19896]
[Bug #19896]
fix memory leak in vm_method
This introduces a unified reference_count to clarify who is referencing a method.
This also allows us to treat the refinement method as the def owner since it counts itself as a reference
Co-authored-by: Peter Zhu <peter@peterzhu.ca>
---
gc.c | 4 +-
method.h | 6 +--
rjit_c.rb | 6 +--
test/ruby/test_module.rb | 4 +-
vm_insnhelper.c | 2 +-
vm_method.c | 105 +++++++++++++++++++----------------------------
6 files changed, 54 insertions(+), 73 deletions(-)
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_module.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb index 9d9b7243d2..425cbdf031 100644 --- a/test/ruby/test_module.rb +++ b/test/ruby/test_module.rb @@ -3290,7 +3290,7 @@ class TestModule < Test::Unit::TestCase end def test_complemented_method_entry_memory_leak - # [Bug #19894] + # [Bug #19894] [Bug #19896] assert_no_memory_leak([], <<~PREP, <<~CODE, rss: true) code = proc do $c = Class.new do @@ -3314,7 +3314,7 @@ class TestModule < Test::Unit::TestCase end 1_000.times(&code) PREP - 100_000.times(&code) + 300_000.times(&code) CODE end |
