Show where objects were allocated on allocation count tests

This commit is contained in:
Yusuke Endoh 2024-08-03 00:13:42 +09:00
parent 04a6165ac0
commit 23837c5170
Notes: git 2024-08-02 20:25:50 +00:00

View File

@ -18,7 +18,14 @@ class TestStringMemory < Test::Unit::TestCase
end end
end end
return allocations return allocations.map do |instance|
[
ObjectSpace.allocation_sourcefile(instance),
ObjectSpace.allocation_sourceline(instance),
instance.class,
instance,
]
end
ensure ensure
GC.enable GC.enable
end end