Project

General

Profile

Actions

Feature #19474

closed

Reduce the number of NEWOBJ macros

Added by eightbitraptor (Matthew Valentine-House) about 1 year ago. Updated about 1 year ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:112671]

Description

Github PR

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 of RB_RVARGC_NEWOBJ_OF
  • RB_EC_NEWOBJ_OF, an alias of RB_RVARGC_EC_NEWOBJ_OF
  • NEWOBJ_OF, an alias of RB_RVARGC_NEWOBJ_OF
  • RVARGC_NEWOBJ_OF, an alias of RB_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 #1

Updated by eightbitraptor (Matthew Valentine-House) about 1 year ago

  • Description updated (diff)
Actions #2

Updated by eightbitraptor (Matthew Valentine-House) about 1 year 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

Actions

Also available in: Atom PDF

Like0
Like0Like0