diff options
author | Peter Zhu <peter@peterzhu.ca> | 2022-01-11 15:19:39 -0500 |
---|---|---|
committer | Peter Zhu <peter@peterzhu.ca> | 2022-01-12 12:00:55 -0500 |
commit | 2d81a718eca679b9bf458beccf1e7a86b812c3e2 (patch) | |
tree | a9c7dc5455d787641210cfc8a93c24a20cf3e78a /test/-ext- | |
parent | e28dbd0f3d08536d61e4e2c0ac938161ac16f29f (diff) | |
download | ruby-2d81a718eca679b9bf458beccf1e7a86b812c3e2.tar.gz |
Make embedded string length a long for VWA
A short (2 bytes) will cause unaligned struct accesses when strings are
used as a buffer to directly store binary data.
Diffstat (limited to 'test/-ext-')
-rw-r--r-- | test/-ext-/string/test_capacity.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/-ext-/string/test_capacity.rb b/test/-ext-/string/test_capacity.rb index 583c98fca4..6b3172a46d 100644 --- a/test/-ext-/string/test_capacity.rb +++ b/test/-ext-/string/test_capacity.rb @@ -66,7 +66,7 @@ class Test_StringCapacity < Test::Unit::TestCase def embed_header_size if GC.using_rvargc? - 2 * RbConfig::SIZEOF['void*'] + RbConfig::SIZEOF['short'] + 2 * RbConfig::SIZEOF['void*'] + RbConfig::SIZEOF['long'] else 2 * RbConfig::SIZEOF['void*'] end |