summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJean Boussier <[email protected]>2025-04-21 10:21:55 +0900
committerJean Boussier <[email protected]>2025-04-24 10:14:29 +0200
commitcb1ea54bbf6cdf49c53f42720fec1a151069810c (patch)
tree4f4ae5a0bc938c57a78a8fab4d9b57530118fa85 /test
parent7af5a632f42b031767cc211543aa4aee75b6fafc (diff)
objspace_dump: Include `shareable` flag
Given that the currently planned ractor local GC implementation performance will heavilly be influenced by the number of shareable objects it would be valuable to be able to know how many of them are in the heap.
Diffstat (limited to 'test')
-rw-r--r--test/objspace/test_objspace.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/objspace/test_objspace.rb b/test/objspace/test_objspace.rb
index c25882a580..e1aa57e46e 100644
--- a/test/objspace/test_objspace.rb
+++ b/test/objspace/test_objspace.rb
@@ -977,6 +977,13 @@ class TestObjSpace < Test::Unit::TestCase
assert_equal class_name, JSON.parse(json)["name"]
end
+ def test_dump_include_shareable
+ omit 'Not provided by mmtk' if RUBY_DESCRIPTION.include?("+GC[mmtk]")
+
+ assert_include(ObjectSpace.dump(ENV), '"shareable":true')
+ assert_not_include(ObjectSpace.dump([]), '"shareable":true')
+ end
+
def test_utf8_method_names
name = "utf8_❨╯°□°❩╯︵┻━┻"
obj = ObjectSpace.trace_object_allocations do