From 23837c5170180b2e6046961ae09de8688e64a0a2 Mon Sep 17 00:00:00 2001 From: Yusuke Endoh Date: Sat, 3 Aug 2024 00:13:42 +0900 Subject: Show where objects were allocated on allocation count tests --- test/ruby/test_string_memory.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'test/ruby/test_string_memory.rb') 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 -- cgit v1.2.3