diff options
| author | Yusuke Endoh <mame@ruby-lang.org> | 2024-08-03 00:13:42 +0900 |
|---|---|---|
| committer | Yusuke Endoh <mame@ruby-lang.org> | 2024-08-03 05:25:28 +0900 |
| commit | 23837c5170180b2e6046961ae09de8688e64a0a2 (patch) | |
| tree | ce9cc6daf928b24feb5432f68c872baa4cd7bf73 /test/ruby | |
| parent | 04a6165ac07f8f2107fbbd3a5665944fb27bc092 (diff) | |
Show where objects were allocated on allocation count tests
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/11297
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_string_memory.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/test/ruby/test_string_memory.rb b/test/ruby/test_string_memory.rb index 3952d10343..249aa3a269 100644 --- a/test/ruby/test_string_memory.rb +++ b/test/ruby/test_string_memory.rb @@ -18,7 +18,14 @@ class TestStringMemory < Test::Unit::TestCase end end - return allocations + return allocations.map do |instance| + [ + ObjectSpace.allocation_sourcefile(instance), + ObjectSpace.allocation_sourceline(instance), + instance.class, + instance, + ] + end ensure GC.enable end |
