Bug #19425
closedMerge the internal only "private" GC headers together
Description
Github PR: 7273
Currently we have 4 headers named gc.h
gc.h
internal/gc.h
include/ruby/internal/gc.h
include/ruby/internal/intern/gc.h
The first two are private and internal to the CRuby codebase, the latter 2 are visible to C extensions. This PR attempts to merge the two internal headers gc.h
and internal/gc.h
into a single header internal/gc.h
in order to simplify the codebase and put all the gc related interface in a single place.
Here is the history of the 2 internal only gc.h
headers as I've been able to understand from the commit logs:
-
gc.h
was created as part of the YARV merge in 2006, it contained only somedefines
for debug related macros. - In 2010 some function declarations were added to it to expose some functionality (
rb_objspace_each_objects
) to theobjspace
extension - In May 2011
internal.h
was created as a place to put shared, but internal only declarations. - In June 2011 GC related functions started being committed to
internal.h
- In 2019
internal.h
was refactored andinternal/gc.h
was created
As of 2023 internally used code continues to be added to both gc.h
and internal/gc.h
, which one is chosen in any particular circumstance seems to be whichever header is already being included for legacy reasons in the .c
file being edited.
I'd like to merge these two files together in order to reduce the cognitive overhead of working on the GC. Am I missing something - are there good reasons why these files should remain separate?