summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Patterson <[email protected]>2023-03-22 08:47:29 -0700
committerAaron Patterson <[email protected]>2023-03-22 12:50:42 -0700
commit999ccb2b6b244e8a128ce8ff32665f83e2da535f ()
treeee9e4c3f403b70e005069561b7c43389f1954e56
parente055c0c7162d7d240c93227397cf3eca01ca86e7 (diff)
combine allocation functions
Notes: Merged: https://.com/ruby/ruby/pull/7512
-rw-r--r--shape.c19
1 files changed, 6 insertions, 13 deletions
@@ -136,24 +136,21 @@ rb_shape_alloc_with_parent_id(ID edge_name, shape_id_t parent_id)
shape->edge_name = edge_name;
shape->next_iv_index = 0;
shape->parent_id = parent_id;
return shape;
}
static rb_shape_t *
-rb_shape_alloc_with_size_pool_index(ID edge_name, rb_shape_t * parent, uint8_t size_pool_index)
{
rb_shape_t * shape = rb_shape_alloc_with_parent_id(edge_name, rb_shape_id(parent));
- shape->size_pool_index = size_pool_index;
return shape;
}
-static rb_shape_t *
-rb_shape_alloc(ID edge_name, rb_shape_t * parent)
-{
- return rb_shape_alloc_with_size_pool_index(edge_name, parent, parent->size_pool_index);
-}
-
static rb_shape_t*
get_next_shape_internal(rb_shape_t * shape, ID id, enum shape_type shape_type, bool * variation_created, bool new_shapes_allowed, bool new_shape_necessary)
{
@@ -182,11 +179,7 @@ get_next_shape_internal(rb_shape_t * shape, ID id, enum shape_type shape_type, b
else {
*variation_created = had_edges;
- rb_shape_t * new_shape = rb_shape_alloc(id, shape);
-
- new_shape->type = (uint8_t)shape_type;
- new_shape->capacity = shape->capacity;
- new_shape->edges = NULL;
switch (shape_type) {
case SHAPE_IVAR: