Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add public statement to Base.GC #54213

Merged
merged 2 commits into from
Apr 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions base/gcutils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ Module with garbage collection utilities.
"""
module GC

public gc, enable, @preserve, safepoint, enable_logging, logging_enabled
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think enable_logging and logging_enabled should maybe not have been made public?

I understand public to be part of the API guarantee?

Copy link
Member

@LilithHafner LilithHafner Apr 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, public means that the statements made about those functions in their doc-strings or elsewhere in the non-devdocs manual will continue to hold in all future nonbreaking versions.

help?> GC.enable_logging
  GC.enable_logging(on::Bool)

  When turned on, print statistics about each GC to stderr.

help?> GC.logging_enabled
  GC.logging_enabled()

  Return whether GC logging has been enabled via GC.enable_logging.

Notably, the specific statistics printed are not specified in the docstrings.


I'm happy to make a followup PR which clarifies that the statistics might change over time or to simply back out logging altogether if you would prefer.


# mirrored from julia.h
const GC_AUTO = 0
const GC_FULL = 1
Expand Down