@@ -127,7 +127,6 @@ struct rb_classext_struct {
127
127
bool shared_const_tbl : 1 ;
128
128
bool iclass_is_origin : 1 ;
129
129
bool iclass_origin_shared_mtbl : 1 ;
130
- bool superclasses_owner : 1 ;
131
130
bool superclasses_with_self : 1 ;
132
131
VALUE classpath ;
133
132
};
@@ -198,7 +197,6 @@ static inline rb_classext_t * RCLASS_EXT_WRITABLE(VALUE obj);
198
197
#define RCLASSEXT_SHARED_CONST_TBL (ext ) (ext->shared_const_tbl)
199
198
#define RCLASSEXT_ICLASS_IS_ORIGIN (ext ) (ext->iclass_is_origin)
200
199
#define RCLASSEXT_ICLASS_ORIGIN_SHARED_MTBL (ext ) (ext->iclass_origin_shared_mtbl)
201
- #define RCLASSEXT_SUPERCLASSES_OWNER (ext ) (ext->superclasses_owner)
202
200
#define RCLASSEXT_SUPERCLASSES_WITH_SELF (ext ) (ext->superclasses_with_self)
203
201
#define RCLASSEXT_CLASSPATH (ext ) (ext->classpath)
204
202
@@ -227,9 +225,6 @@ static inline void RCLASSEXT_SET_INCLUDER(rb_classext_t *ext, VALUE klass, VALUE
227
225
* so always those should be writable.
228
226
*/
229
227
#define RCLASS_CVC_TBL (c ) (RCLASS_EXT_READABLE(c)->cvc_tbl)
230
- #define RCLASS_SUPERCLASS_DEPTH (c ) (RCLASS_EXT_READABLE(c)->superclass_depth)
231
- #define RCLASS_SUPERCLASSES (c ) (RCLASS_EXT_READABLE(c)->superclasses)
232
- #define RCLASS_SUPERCLASSES_WITH_SELF_P (c ) (RCLASS_EXT_READABLE(c)->superclasses_with_self)
233
228
#define RCLASS_SUBCLASSES_X (c ) (RCLASS_EXT_READABLE(c)->subclasses)
234
229
#define RCLASS_SUBCLASSES_FIRST (c ) (RCLASS_EXT_READABLE(c)->subclasses->head->next)
235
230
#define RCLASS_ORIGIN (c ) (RCLASS_EXT_READABLE(c)->origin_)
@@ -240,6 +235,11 @@ static inline void RCLASSEXT_SET_INCLUDER(rb_classext_t *ext, VALUE klass, VALUE
240
235
#define RCLASS_CLONED_P (c ) (RCLASS_EXT_READABLE(c)->cloned)
241
236
#define RCLASS_CLASSPATH (c ) (RCLASS_EXT_READABLE(c)->classpath)
242
237
238
+ // Superclasses can't be changed after initialization
239
+ #define RCLASS_SUPERCLASS_DEPTH (c ) (RCLASS_EXT_PRIME(c)->superclass_depth)
240
+ #define RCLASS_SUPERCLASSES (c ) (RCLASS_EXT_PRIME(c)->superclasses)
241
+ #define RCLASS_SUPERCLASSES_WITH_SELF_P (c ) (RCLASS_EXT_PRIME(c)->superclasses_with_self)
242
+
243
243
// namespaces don't make changes on these refined_class/attached_object/includer
244
244
#define RCLASS_REFINED_CLASS (c ) (RCLASS_EXT_PRIME(c)->refined_class)
245
245
#define RCLASS_ATTACHED_OBJECT (c ) (RCLASS_EXT_PRIME(c)->as.singleton_class.attached_object)
@@ -270,7 +270,7 @@ static inline void RCLASS_WRITE_CC_TBL(VALUE klass, struct rb_id_table *table);
270
270
static inline void RCLASS_SET_CVC_TBL (VALUE klass , struct rb_id_table * table );
271
271
static inline void RCLASS_WRITE_CVC_TBL (VALUE klass , struct rb_id_table * table );
272
272
273
- static inline void RCLASS_WRITE_SUPERCLASSES (VALUE klass , size_t depth , VALUE * superclasses , bool owns_it , bool with_self );
273
+ static inline void RCLASS_WRITE_SUPERCLASSES (VALUE klass , size_t depth , VALUE * superclasses , bool with_self );
274
274
static inline void RCLASS_SET_SUBCLASSES (VALUE klass , rb_subclass_anchor_t * anchor );
275
275
static inline void RCLASS_WRITE_NS_SUPER_SUBCLASSES (VALUE klass , rb_ns_subclasses_t * ns_subclasses );
276
276
static inline void RCLASS_WRITE_NS_MODULE_SUBCLASSES (VALUE klass , rb_ns_subclasses_t * ns_subclasses );
@@ -714,14 +714,13 @@ RCLASS_SET_INCLUDER(VALUE iclass, VALUE klass)
714
714
}
715
715
716
716
static inline void
717
- RCLASS_WRITE_SUPERCLASSES (VALUE klass , size_t depth , VALUE * superclasses , bool owns_it , bool with_self )
717
+ RCLASS_WRITE_SUPERCLASSES (VALUE klass , size_t depth , VALUE * superclasses , bool with_self )
718
718
{
719
719
RUBY_ASSERT (depth <= RCLASS_MAX_SUPERCLASS_DEPTH );
720
720
721
- rb_classext_t * ext = RCLASS_EXT_WRITABLE (klass );
721
+ rb_classext_t * ext = RCLASS_EXT_PRIME (klass );
722
722
RCLASSEXT_SUPERCLASS_DEPTH (ext ) = depth ;
723
723
RCLASSEXT_SUPERCLASSES (ext ) = superclasses ;
724
- RCLASSEXT_SUPERCLASSES_OWNER (ext ) = owns_it ;
725
724
RCLASSEXT_SUPERCLASSES_WITH_SELF (ext ) = with_self ;
726
725
}
727
726
0 commit comments