summaryrefslogtreecommitdiff
path: root/shape.h
diff options
context:
space:
mode:
authorJean Boussier <jean.boussier@gmail.com>2025-06-12 15:15:20 +0200
committerJean Boussier <jean.boussier@gmail.com>2025-06-12 17:08:22 +0200
commitde4b9103815926bb43d5af3f0cb5dbea3749fe2f (patch)
tree6a249f3e61df018d58011b6d1da2ed385d6ae8f1 /shape.h
parente070d93573967423064707e09b566a33dd14a0e3 (diff)
Get rid of GET_SHAPE_TREE()
It's a useless indirection.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/13596
Diffstat (limited to 'shape.h')
-rw-r--r--shape.h13
1 files changed, 3 insertions, 10 deletions
diff --git a/shape.h b/shape.h
index 55f2900dd6..2cd35c5ae9 100644
--- a/shape.h
+++ b/shape.h
@@ -94,7 +94,7 @@ typedef struct {
} rb_shape_tree_t;
RUBY_SYMBOL_EXPORT_BEGIN
-RUBY_EXTERN rb_shape_tree_t *rb_shape_tree_ptr;
+RUBY_EXTERN rb_shape_tree_t *rb_shape_tree;
RUBY_SYMBOL_EXPORT_END
union rb_attr_index_cache {
@@ -105,13 +105,6 @@ union rb_attr_index_cache {
} unpack;
};
-static inline rb_shape_tree_t *
-rb_current_shape_tree(void)
-{
- return rb_shape_tree_ptr;
-}
-#define GET_SHAPE_TREE() rb_current_shape_tree()
-
static inline shape_id_t
RBASIC_SHAPE_ID(VALUE obj)
{
@@ -158,7 +151,7 @@ RSHAPE(shape_id_t shape_id)
uint32_t offset = (shape_id & SHAPE_ID_OFFSET_MASK);
RUBY_ASSERT(offset != INVALID_SHAPE_ID);
- return &GET_SHAPE_TREE()->shape_list[offset];
+ return &rb_shape_tree->shape_list[offset];
}
int32_t rb_shape_id_offset(void);
@@ -247,7 +240,7 @@ RSHAPE_EMBEDDED_CAPACITY(shape_id_t shape_id)
{
uint8_t heap_index = rb_shape_heap_index(shape_id);
if (heap_index) {
- return GET_SHAPE_TREE()->capacities[heap_index - 1];
+ return rb_shape_tree->capacities[heap_index - 1];
}
return 0;
}