From: "eightbitraptor (Matthew Valentine-House) via ruby-core" Date: 2023-02-08T15:09:38+00:00 Subject: [ruby-core:112287] [Ruby master Bug#19425] Merge the internal only "private" GC headers together Issue #19425 has been reported by eightbitraptor (Matthew Valentine-House). ---------------------------------------- Bug #19425: Merge the internal only "private" GC headers together https://bugs.ruby-lang.org/issues/19425 * Author: eightbitraptor (Matthew Valentine-House) * Status: Open * Priority: Normal * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- Github PR: [7273](https://github.com/ruby/ruby/pull/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](https://github.com/ruby/ruby/pull/7273) 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 some `defines` for debug related macros. * In 2010 some function declarations were added to it to expose some functionality (`rb_objspace_each_objects`) to the `objspace` 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 and `internal/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? -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/