summaryrefslogtreecommitdiff
path: root/shape.h
diff options
context:
space:
mode:
Diffstat (limited to 'shape.h')
-rw-r--r--shape.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/shape.h b/shape.h
index c6eb1981d0..d7c80be9bc 100644
--- a/shape.h
+++ b/shape.h
@@ -146,6 +146,22 @@ RBASIC_SET_SHAPE_ID(VALUE obj, shape_id_t shape_id)
RUBY_ASSERT(rb_shape_verify_consistency(obj, shape_id));
}
+void rb_set_namespaced_class_shape_id(VALUE obj, shape_id_t shape_id);
+
+static inline void
+RB_SET_SHAPE_ID(VALUE obj, shape_id_t shape_id)
+{
+ switch (BUILTIN_TYPE(obj)) {
+ case T_CLASS:
+ case T_MODULE:
+ rb_set_namespaced_class_shape_id(obj, shape_id);
+ break;
+ default:
+ RBASIC_SET_SHAPE_ID(obj, shape_id);
+ break;
+ }
+}
+
static inline rb_shape_t *
RSHAPE(shape_id_t shape_id)
{