diff options
author | Aaron Patterson <[email protected]> | 2022-11-17 15:57:11 -0800 |
---|---|---|
committer | Aaron Patterson <[email protected]> | 2022-11-18 08:31:56 -0800 |
commit | 10788166e7e568fdcd0b748e8d5dab442dcdc7ef (patch) | |
tree | ee195186a3fed8333bc1875f66ddab0c85c3d7db /variable.c | |
parent | f0ce1186620273a1182e6084559765143099eb88 (diff) |
Differentiate T_OBJECT shapes from other objects
We would like to differentiate types of objects via their shape. This
commit adds a special T_OBJECT shape when we allocate an instance of
T_OBJECT. This allows us to avoid testing whether an object is an
instance of a T_OBJECT or not, we can just check the shape.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/6758
Diffstat (limited to 'variable.c')
-rw-r--r-- | variable.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/variable.c b/variable.c index daae90396e..15e18f21ae 100644 --- a/variable.c +++ b/variable.c @@ -1606,6 +1606,7 @@ iterate_over_shapes_with_callback(rb_shape_t *shape, rb_ivar_foreach_callback_fu case SHAPE_CAPACITY_CHANGE: case SHAPE_FROZEN: case SHAPE_IVAR_UNDEF: + case SHAPE_T_OBJECT: iterate_over_shapes_with_callback(rb_shape_get_parent(shape), callback, itr_data); return; } |