summaryrefslogtreecommitdiff
path: root/test/objspace/test_objspace.rb
diff options
context:
space:
mode:
authorAaron Patterson <tenderlove@ruby-lang.org>2020-08-18 17:34:03 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2020-08-18 19:10:51 -0700
commit7a58ee9b962ad0072e5213d3512c809048e4eba1 (patch)
treef74ee3e8e7b2fd2a1a3d3251a073fad008beae4f /test/objspace/test_objspace.rb
parent371c051ca885274a9991e216b6ff6b75fb5c7ff9 (diff)
Update references when tracing allocations
The allocation tracing code keeps essentially a weak reference to objects that have been allocated (storing the allocation information along with the weak ref). Compacting the heap would break references in this weak map, so the wrong values could be returned. This commit just updates the values in the weak ref in order to fix the allocation tracing book keeping
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3429
Diffstat (limited to 'test/objspace/test_objspace.rb')
-rw-r--r--test/objspace/test_objspace.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/objspace/test_objspace.rb b/test/objspace/test_objspace.rb
index 28c0431456..42fbc3e03c 100644
--- a/test/objspace/test_objspace.rb
+++ b/test/objspace/test_objspace.rb
@@ -194,7 +194,7 @@ class TestObjSpace < Test::Unit::TestCase
assert_equal(self.class.name, ObjectSpace.allocation_class_path(o3))
assert_equal(__method__, ObjectSpace.allocation_method_id(o3))
}
- end if false # TODO: tenderlove is debugging it [Tue Aug 18 11:00:49 2020 JST]
+ end
def test_trace_object_allocations_start_stop_clear
ObjectSpace.trace_object_allocations_clear # clear object_table to get rid of erroneous detection for obj3