mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
shape.c: refactor frozen shape to no longer be final
This opens the door to store more informations in shapes, such as the `object_id` or object address in case it has been observed and the object has to be moved.
This commit is contained in:
parent
6c9b3ac232
commit
d34c150547
Notes:
git
2025-05-08 05:58:19 +00:00
3 changed files with 20 additions and 2 deletions
2
object.c
2
object.c
|
@ -358,7 +358,7 @@ rb_obj_copy_ivar(VALUE dest, VALUE obj)
|
|||
|
||||
rb_shape_t *initial_shape = rb_shape_get_shape(dest);
|
||||
|
||||
if (initial_shape->heap_index != src_shape->heap_index) {
|
||||
if (initial_shape->heap_index != src_shape->heap_index || !rb_shape_canonical_p(src_shape)) {
|
||||
RUBY_ASSERT(initial_shape->type == SHAPE_T_OBJECT);
|
||||
|
||||
shape_to_set_on_dest = rb_shape_rebuild_shape(initial_shape, src_shape);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue