-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Add shape_id to RBasic under 32 bit #13341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
96f185e
to
9755585
Compare
#if RBASIC_SHAPE_ID_FIELD | ||
RBASIC(obj)->shape_id = 0; | ||
#endif | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is added, how about adding RBASIC_FLAGS & RBASIC_SET_FLAGS as in oracle/truffleruby#3118 (comment) ?
That would help reduce the amount of direct accesses to that field, and could add extra asserts (e.g. catching some code trying to set the frozen flag directly), etc.
Should RBASIC_SET_FLAGS(obj, 0)
reset the shape too?
@@ -153,4 +166,13 @@ RBASIC_CLASS(VALUE obj) | |||
return RBASIC(obj)->klass; | |||
} | |||
|
|||
static inline void | |||
RBASIC_RESET_FLAGS(VALUE obj) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be in public headers (it is in the current state of this PR) or under internal/**/*.h
?
IOW, do you think any C extension would need this, or just CRuby .c files?
[Feature #21353]
This adds a separate VALUE-sized shape_id field for 32-bit platforms. Allowing them to work much more similarly to how shapes always being available on 64-bit.
This does increase the size of objects by 4 bytes on 32 bit platforms, but shape access should be faster, more consistent, of the same size (32 bits) and much simpler.