diff options
author | Peter Zhu <[email protected]> | 2022-01-14 13:59:38 -0500 |
---|---|---|
committer | Peter Zhu <[email protected]> | 2022-01-14 14:36:33 -0500 |
commit | 6b7eff90860d4fb4db01ec4d1f522afa6d809632 (patch) | |
tree | c545242eaf1dfeb27a1ec59d0cb181429584af88 /class.c | |
parent | ca3d405242c722c8140944bda7278c2a9e5a7139 (diff) |
Separately allocate class_serial on 32-bit systems
On 32-bit systems, VWA causes class_serial to not be aligned (it only
guarantees 4 byte alignment but class_serial is 8 bytes and requires 8
byte alignment). This commit uses a hack to allocate class_serial
through malloc. Once VWA allocates with 8 byte alignment in the future,
we will revert this commit.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/5442
Diffstat (limited to 'class.c')
-rw-r--r-- | class.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -208,6 +208,9 @@ class_alloc(VALUE flags, VALUE klass) #if USE_RVARGC memset(RCLASS_EXT(obj), 0, sizeof(rb_classext_t)); +# if SIZEOF_SERIAL_T != SIZEOF_VALUE + RCLASS(obj)->class_serial_ptr = ZALLOC(rb_serial_t); +# endif #else obj->ptr = ZALLOC(rb_classext_t); #endif |