mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Enforce consistency between shape_id and FL_EXIVAR
The FL_EXIVAR is a bit redundant with the shape_id. Now that the `shape_id` is embedded in all objects on all archs, we can cheaply check if an object has any fields with a simple bitmask.
This commit is contained in:
parent
f2d7c6afee
commit
b51078f82e
Notes:
git
2025-06-13 21:50:44 +00:00
4 changed files with 59 additions and 18 deletions
7
shape.c
7
shape.c
|
@ -1266,6 +1266,13 @@ rb_shape_verify_consistency(VALUE obj, shape_id_t shape_id)
|
|||
}
|
||||
}
|
||||
|
||||
if (FL_TEST_RAW(obj, FL_EXIVAR)) {
|
||||
RUBY_ASSERT(rb_obj_has_exivar(obj));
|
||||
}
|
||||
else {
|
||||
RUBY_ASSERT(!rb_obj_has_exivar(obj));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue