Feature #19474
closedReduce the number of NEWOBJ macros
Description
Since the introduction of variable width allocation with RVARGC
there are a lot of different *NEWOBJ*
macros. Currently there are:
RB_RVARGC_NEWOBJ_OF
RB_RVARGC_EC_NEWOBJ_OF
-
RB_NEWOBJ_OF
, an alias ofRB_RVARGC_NEWOBJ_OF
-
RB_EC_NEWOBJ_OF
, an alias ofRB_RVARGC_EC_NEWOBJ_OF
-
NEWOBJ_OF
, an alias ofRB_RVARGC_NEWOBJ_OF
-
RVARGC_NEWOBJ_OF
, an alias ofRB_RVARGC_NEWOBJ_OF
This PR merges RB_RVARGC_NEWOBJ_OF
,RB_RVARGC_EC_NEWOBJ_OF
, RVARGC_NEWOBJ_OF
, RB_NEWOBJ_OF
and NEWOBJ_OF
into a single macro that takes an execution context as an argument (which can be NULL
; if so then the current execution context is found and used using GET_EC()
).
The resulting single macro has been named NEWOBJ_OF
to reflect that it should now be the only way of creating new objects.
Both RB_NEWOBJ_OF
and NEWOBJ_OF
have seperate implementations that are part of the public API exposed in include/ruby/internal/newobj.h
so they are available to extension authors. These have not been modified in any way.
Updated by eightbitraptor (Matt V-H) almost 2 years ago
- Description updated (diff)
Updated by eightbitraptor (Matt V-H) almost 2 years ago
- Status changed from Open to Closed
Applied in changeset git|026321c5b976c5e95731046b94555b1226198be4.
[Feature #19474] Refactor NEWOBJ macros
NEWOBJ_OF is now our canonical newobj macro. It takes an optional ec