diff options
author | Matt Valentine-House <matt@eightbitraptor.com> | 2023-02-17 15:51:16 +0000 |
---|---|---|
committer | Matt Valentine-House <matt@eightbitraptor.com> | 2023-04-06 11:07:16 +0100 |
commit | 026321c5b976c5e95731046b94555b1226198be4 (patch) | |
tree | 35ba000a654e41ede4ccb9a30322f08b748cb2f7 /array.c | |
parent | 879cda98a4cdce91d736ea9ba81168effe090718 (diff) |
[Feature #19474] Refactor NEWOBJ macros
NEWOBJ_OF is now our canonical newobj macro. It takes an optional ec
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/7393
Diffstat (limited to 'array.c')
-rw-r--r-- | array.c | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -778,9 +778,9 @@ ary_alloc_embed(VALUE klass, long capa) { size_t size = ary_embed_size(capa); assert(rb_gc_size_allocatable_p(size)); - RVARGC_NEWOBJ_OF(ary, struct RArray, klass, + NEWOBJ_OF(ary, struct RArray, klass, T_ARRAY | RARRAY_EMBED_FLAG | (RGENGC_WB_PROTECTED_ARRAY ? FL_WB_PROTECTED : 0), - size); + size, 0); /* Created array is: * FL_SET_EMBED((VALUE)ary); * ARY_SET_EMBED_LEN((VALUE)ary, 0); @@ -791,9 +791,9 @@ ary_alloc_embed(VALUE klass, long capa) static VALUE ary_alloc_heap(VALUE klass) { - RVARGC_NEWOBJ_OF(ary, struct RArray, klass, + NEWOBJ_OF(ary, struct RArray, klass, T_ARRAY | (RGENGC_WB_PROTECTED_ARRAY ? FL_WB_PROTECTED : 0), - sizeof(struct RArray)); + sizeof(struct RArray), 0); return (VALUE)ary; } @@ -890,9 +890,9 @@ ec_ary_alloc_embed(rb_execution_context_t *ec, VALUE klass, long capa) { size_t size = ary_embed_size(capa); assert(rb_gc_size_allocatable_p(size)); - RB_RVARGC_EC_NEWOBJ_OF(ec, ary, struct RArray, klass, - T_ARRAY | RARRAY_EMBED_FLAG | (RGENGC_WB_PROTECTED_ARRAY ? FL_WB_PROTECTED : 0), - size); + NEWOBJ_OF(ary, struct RArray, klass, + T_ARRAY | RARRAY_EMBED_FLAG | (RGENGC_WB_PROTECTED_ARRAY ? FL_WB_PROTECTED : 0), + size, ec); /* Created array is: * FL_SET_EMBED((VALUE)ary); * ARY_SET_EMBED_LEN((VALUE)ary, 0); @@ -903,9 +903,9 @@ ec_ary_alloc_embed(rb_execution_context_t *ec, VALUE klass, long capa) static VALUE ec_ary_alloc_heap(rb_execution_context_t *ec, VALUE klass) { - RB_RVARGC_EC_NEWOBJ_OF(ec, ary, struct RArray, klass, - T_ARRAY | (RGENGC_WB_PROTECTED_ARRAY ? FL_WB_PROTECTED : 0), - sizeof(struct RArray)); + NEWOBJ_OF(ary, struct RArray, klass, + T_ARRAY | (RGENGC_WB_PROTECTED_ARRAY ? FL_WB_PROTECTED : 0), + sizeof(struct RArray), ec); return (VALUE)ary; } |