summaryrefslogtreecommitdiff
path: root/shape.c
diff options
context:
space:
mode:
authorJean Boussier <[email protected]>2025-05-05 11:10:08 +0200
committerJean Boussier <[email protected]>2025-05-08 07:58:05 +0200
commit6c9b3ac232fc65f6019af28ec836aa59b8657b70 ()
tree329276bd5e1b3fca7cd9771be835313befb0d671 /shape.c
parent0ea210d1ea257162642969edce665935cc87c643 (diff)
Refactor OBJ_TOO_COMPLEX_SHAPE_ID to not be referenced outside shape.h
Also refactor checks for `->type == SHAPE_OBJ_TOO_COMPLEX`.
Notes: Merged: https://.com/ruby/ruby/pull/13159
-rw-r--r--shape.c21
1 files changed, 19 insertions, 2 deletions
@@ -495,7 +495,7 @@ get_next_shape_internal(rb_shape_t *shape, ID id, enum shape_type shape_type, bo
rb_shape_t *res = NULL;
// There should never be outgoing edges from "too complex"
- RUBY_ASSERT(rb_shape_id(shape) != OBJ_TOO_COMPLEX_SHAPE_ID);
*variation_created = false;
@@ -573,7 +573,7 @@ get_next_shape_internal(rb_shape_t *shape, ID id, enum shape_type shape_type, bo
return res;
}
-int
rb_shape_frozen_shape_p(rb_shape_t *shape)
{
return SHAPE_FROZEN == (enum shape_type)shape->type;
@@ -703,6 +703,11 @@ rb_shape_transition_shape_frozen(VALUE obj)
return next_shape;
}
/*
* This function is used for assertions where we don't want to increment
* max_iv_count
@@ -1012,6 +1017,18 @@ rb_shape_obj_too_complex(VALUE obj)
return rb_shape_get_shape_id(obj) == OBJ_TOO_COMPLEX_SHAPE_ID;
}
size_t
rb_shape_edges_count(rb_shape_t *shape)
{