Project

General

Profile

Actions

Bug #19425

closed

Merge the internal only "private" GC headers together

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

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

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 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?

Updated by ko1 (Koichi Sasada) about 1 year ago

No problem.

Actions #2

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

  • Description updated (diff)
Actions #3

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

  • Status changed from Open to Closed

Applied in changeset git|72aba64fff09a829bfaf41165d0075066f087185.


Merge gc.h and internal/gc.h

[Feature #19425]

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0