diff options
author | Jemma Issroff <[email protected]> | 2022-10-03 11:14:32 -0400 |
---|---|---|
committer | Aaron Patterson <[email protected]> | 2022-10-11 08:40:56 -0700 |
commit | ad63b668e22e21c352b852f3119ae98a7acf99f1 (patch) | |
tree | cdaea65a9cae753a25f521c06d9d6a205085335f /ractor_core.h | |
parent | 5ffbb2be187681a37f2722ce1d7db4ec5c128464 (diff) |
Revert "Revert "This commit implements the Object Shapes technique in CRuby.""
This reverts commit 9a6803c90b817f70389cae10d60b50ad752da48f.
Diffstat (limited to 'ractor_core.h')
-rw-r--r-- | ractor_core.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ractor_core.h b/ractor_core.h index a065f5f809..9d4b8387c7 100644 --- a/ractor_core.h +++ b/ractor_core.h @@ -289,11 +289,13 @@ rb_ractor_id(const rb_ractor_t *r) #if RACTOR_CHECK_MODE > 0 uint32_t rb_ractor_current_id(void); +// If ractor check mode is enabled, shape bits needs to be smaller +STATIC_ASSERT(shape_bits, SHAPE_BITS == 16); static inline void rb_ractor_setup_belonging_to(VALUE obj, uint32_t rid) { - VALUE flags = RBASIC(obj)->flags & 0xffffffff; // 4B + VALUE flags = RBASIC(obj)->flags & 0xffff0000ffffffff; // 4B RBASIC(obj)->flags = flags | ((VALUE)rid << 32); } @@ -310,7 +312,7 @@ rb_ractor_belonging(VALUE obj) return 0; } else { - return RBASIC(obj)->flags >> 32; + return RBASIC(obj)->flags >> 32 & 0xFFFF; } } |