Actions
Feature #19474
closedReduce the number of NEWOBJ macros
Status:
Closed
Assignee:
-
Target version:
-
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.
Actions
Like0
Like0Like0