diff options
author | Matt Valentine-House <matt@eightbitraptor.com> | 2021-01-26 16:29:09 +0000 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2021-02-01 08:42:54 -0800 |
commit | 7341b0146557bccd783484b279569b530c888a14 (patch) | |
tree | 38fec2f19de18542c2e0d89d6fabd0bbc249d1b4 /class.c | |
parent | 6edd4256744c5ee6a73af660cb2bcb63ca94b254 (diff) |
Add RCLASS_ALLOCATOR Macro
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/4124
Diffstat (limited to 'class.c')
-rw-r--r-- | class.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -188,7 +188,7 @@ class_alloc(VALUE flags, VALUE klass) RCLASS_SET_ORIGIN((VALUE)obj, (VALUE)obj); RCLASS_SERIAL(obj) = rb_next_class_serial(); RB_OBJ_WRITE(obj, &RCLASS_REFINED_CLASS(obj), Qnil); - RCLASS_EXT(obj)->allocator = 0; + RCLASS_ALLOCATOR(obj) = 0; return (VALUE)obj; } @@ -372,7 +372,7 @@ rb_mod_init_copy(VALUE clone, VALUE orig) RBASIC_SET_CLASS(clone, rb_singleton_class_clone(orig)); rb_singleton_class_attached(RBASIC(clone)->klass, (VALUE)clone); } - RCLASS_EXT(clone)->allocator = RCLASS_EXT(orig)->allocator; + RCLASS_ALLOCATOR(clone) = RCLASS_ALLOCATOR(orig); copy_tables(clone, orig); if (RCLASS_M_TBL(orig)) { struct clone_method_arg arg; @@ -409,7 +409,7 @@ rb_mod_init_copy(VALUE clone, VALUE orig) RCLASS_M_TBL(clone_p) = RCLASS_M_TBL(p); RCLASS_CONST_TBL(clone_p) = RCLASS_CONST_TBL(p); RCLASS_IV_TBL(clone_p) = RCLASS_IV_TBL(p); - RCLASS_EXT(clone_p)->allocator = RCLASS_EXT(p)->allocator; + RCLASS_ALLOCATOR(clone_p) = RCLASS_ALLOCATOR(p); if (RB_TYPE_P(clone, T_CLASS)) { RCLASS_SET_INCLUDER(clone_p, clone); } @@ -492,7 +492,7 @@ rb_singleton_class_clone_and_attach(VALUE obj, VALUE attach) } RCLASS_SET_SUPER(clone, RCLASS_SUPER(klass)); - RCLASS_EXT(clone)->allocator = RCLASS_EXT(klass)->allocator; + RCLASS_ALLOCATOR(clone) = RCLASS_ALLOCATOR(klass); if (RCLASS_IV_TBL(klass)) { rb_iv_tbl_copy(clone, klass); } |