summaryrefslogtreecommitdiff
path: root/internal/class.h
diff options
context:
space:
mode:
authorSatoshi Tagomori <[email protected]>2025-05-02 11:30:24 +0900
committerSatoshi Tagomori <[email protected]>2025-05-11 23:32:50 +0900
commitf24ba27d6d88241f0560f12b0b2cb54d8cb40262 ()
tree0d798dbc306d4d1df29d24f495cd06ced3ea711f /internal/class.h
parent4b33b468ac2f20d7b13e691ecc2c7e857b53d356 (diff)
avoid calling ZALLOC after NEWOBJ_OF for RClass: need to return RClass not promoted
-rw-r--r--internal/class.h12
1 files changed, 9 insertions, 3 deletions
@@ -257,7 +257,8 @@ static inline void RCLASS_SET_FIELDS_HASH(VALUE obj, const st_table *table);
static inline void RCLASS_WRITE_FIELDS_HASH(VALUE obj, const st_table *table);
static inline uint32_t RCLASS_FIELDS_COUNT(VALUE obj);
static inline void RCLASS_SET_M_TBL(VALUE klass, struct rb_id_table *table);
-static inline void RCLASS_WRITE_M_TBL(VALUE klass, struct rb_id_table *table);
static inline void RCLASS_SET_CONST_TBL(VALUE klass, struct rb_id_table *table, bool shared);
static inline void RCLASS_WRITE_CONST_TBL(VALUE klass, struct rb_id_table *table, bool shared);
static inline void RCLASS_WRITE_CALLABLE_M_TBL(VALUE klass, struct rb_id_table *table);
@@ -568,10 +569,15 @@ RCLASS_SET_M_TBL(VALUE klass, struct rb_id_table *table)
RCLASSEXT_M_TBL(RCLASS_EXT(klass)) = table;
}
static inline void
-RCLASS_WRITE_M_TBL(VALUE klass, struct rb_id_table *table)
{
- RUBY_ASSERT(!RB_OBJ_PROMOTED(klass));
RCLASSEXT_M_TBL(RCLASS_EXT_WRITABLE(klass)) = table;
}