Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
bpo-28254: Apply suggestions from doc review.
  • Loading branch information
scoder committed Apr 28, 2021
commit 25fb2aa9b341837030eca9aa3d3597d28c183186
11 changes: 6 additions & 5 deletions Doc/c-api/gcsupport.rst
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,12 @@ garbage collection runs.

Comment thread
scoder marked this conversation as resolved.
.. c:function:: Py_ssize_t PyGC_Collect(void)

Performs a garbage collection, if the garbage collector is enabled.
Returns the number of collected + uncollectable objects.
If the garbage collector is disabled or already running,
Perform a full garbage collection, if the garbage collector is enabled.
Returns the number of collected + unreachable objects which cannot
be collected.
If the garbage collector is disabled or already collecting,
returns ``0`` immediately.
Errors during garbage collection are ignored and printed.
Errors during garbage collection are passed to :data:`sys.unraisablehook`.
This function does not raise exceptions.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@pablogsal: Do we want to document that it's safe to call this function with an exception raised, and that the exception is saved and then restored?



Expand All @@ -209,7 +210,7 @@ garbage collection runs.

.. c:function:: int PyGC_IsEnabled(void)

Queries the state of the garbage collector.
Query the state of the garbage collector.
Comment thread
scoder marked this conversation as resolved.
Outdated
Returns the current state, 0 for disabled and 1 for enabled.

.. versionchanged:: 3.10