summaryrefslogtreecommitdiff
path: root/test/objspace
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2022-02-01 09:25:12 -0500
committerPeter Zhu <peter@peterzhu.ca>2022-02-02 09:52:04 -0500
commit7b77d46671685c837adc33b39ae0210e04cd8b24 (patch)
tree426dd92de0af81c4d6cbc3f0af732cc7fe80ede8 /test/objspace
parentaf107710457b4bd148c6e5ee7a336ed4961f5423 (diff)
downloadruby-7b77d46671685c837adc33b39ae0210e04cd8b24.tar.gz
Decouple GC slot sizes from RVALUE
Add a new macro BASE_SLOT_SIZE that determines the slot size. For Variable Width Allocation (compiled with USE_RVARGC=1), all slot sizes are powers-of-2 multiples of BASE_SLOT_SIZE. For USE_RVARGC=0, BASE_SLOT_SIZE is set to sizeof(RVALUE).
Diffstat (limited to 'test/objspace')
-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 a1954d56a9..b7342e899b 100644
--- a/test/objspace/test_objspace.rb
+++ b/test/objspace/test_objspace.rb
@@ -33,7 +33,7 @@ class TestObjSpace < Test::Unit::TestCase
b = a.dup
c = nil
ObjectSpace.each_object(String) {|x| break c = x if x == a and x.frozen?}
- rv_size = GC::INTERNAL_CONSTANTS[:RVALUE_SIZE]
+ rv_size = GC::INTERNAL_CONSTANTS[:BASE_SLOT_SIZE]
assert_equal([rv_size, rv_size, a.length + 1 + rv_size], [a, b, c].map {|x| ObjectSpace.memsize_of(x)})
end