summaryrefslogtreecommitdiff
path: root/shape.c
diff options
context:
space:
mode:
authorJean Boussier <byroot@ruby-lang.org>2023-11-16 17:50:21 +0100
committerJean Boussier <jean.boussier@gmail.com>2023-11-17 09:19:21 +0100
commit94c9f166632a901e563463933efd42e618432d70 (patch)
tree948304c7e1b048d53cba547c49c0bac828066659 /shape.c
parent498b086c374608005278c0f7d105df1925e13a22 (diff)
Refactor rb_obj_evacuate_ivs_to_hash_table
That function is a bit too low level to called from multiple places. It's always used in tandem with `rb_shape_set_too_complex` and both have to know how the object is laid out to update the `iv_ptr`. So instead we can provide two higher level function: - `rb_obj_copy_ivs_to_hash_table` to prepare a `st_table` from an arbitrary oject. - `rb_obj_convert_to_too_complex` to assign the new `st_table` to the old object, and safely free the old `iv_ptr`. Unfortunately both can't be combined into one, because `rb_obj_copy_ivar` need `rb_obj_copy_ivs_to_hash_table` to copy from one object to another.
Diffstat (limited to 'shape.c')
-rw-r--r--shape.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/shape.c b/shape.c
index 588c24604d..7ccf82b246 100644
--- a/shape.c
+++ b/shape.c
@@ -915,13 +915,6 @@ rb_shape_obj_too_complex(VALUE obj)
return rb_shape_get_shape_id(obj) == OBJ_TOO_COMPLEX_SHAPE_ID;
}
-void
-rb_shape_set_too_complex(VALUE obj)
-{
- RUBY_ASSERT(!rb_shape_obj_too_complex(obj));
- rb_shape_set_shape_id(obj, OBJ_TOO_COMPLEX_SHAPE_ID);
-}
-
size_t
rb_shape_edges_count(rb_shape_t *shape)
{