Refactor the last references to rb_shape_t

The type isn't opaque because Ruby isn't often compiled with LTO,
so for optimization purpose it's better to allow as much inlining
as possible.

However ideally only `shape.c` and `shape.h` should deal with
the actual struct, and everything else should just deal with opaque
`shape_id_t`.
This commit is contained in:
Jean Boussier 2025-06-11 14:32:35 +02:00
parent 4463ac264d
commit 95201299fd
Notes: git 2025-06-11 14:38:51 +00:00
8 changed files with 96 additions and 75 deletions

View file

@ -340,7 +340,7 @@ rb_obj_copy_ivar(VALUE dest, VALUE obj)
shape_id_t dest_shape_id = src_shape_id;
shape_id_t initial_shape_id = RBASIC_SHAPE_ID(dest);
RUBY_ASSERT(RSHAPE(initial_shape_id)->type == SHAPE_ROOT);
RUBY_ASSERT(RSHAPE_TYPE_P(initial_shape_id, SHAPE_ROOT));
dest_shape_id = rb_shape_rebuild(initial_shape_id, src_shape_id);
if (UNLIKELY(rb_shape_too_complex_p(dest_shape_id))) {