Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
c4a91e0
Add PyGC_VisitObjects
jbower-fb Feb 8, 2023
57edf6d
📜🤖 Added by blurb_it.
blurb-it[bot] Feb 18, 2023
447bb53
Remove from Limited API
jbower-fb Feb 18, 2023
d4f9505
Merge branch 'main' into gcvisitobjs
hauntsaninja Feb 20, 2023
d34a900
Updated to "unstable" API, protect against GC and current object dele…
jbower-fb Feb 23, 2023
7c1fbbb
Merge branch 'gcvisitobjs' of https://github.com/jbower-fb/cpython-jb…
jbower-fb Feb 23, 2023
9b0c461
Fix formatting in Modules/_testcapimodule.c
jbower-fb Feb 23, 2023
29f7f88
Fix formatting in Modules/_testcapimodule.c
jbower-fb Feb 23, 2023
e16f1e3
Fix formatting in Modules/_testcapimodule.c
jbower-fb Feb 23, 2023
024ee30
Fix formatting in Modules/_testcapimodule.c
jbower-fb Feb 23, 2023
bd65abb
Fix formatting in Modules/gcmodule.c
jbower-fb Feb 23, 2023
f03e581
Fix formatting in Modules/gcmodule.c
jbower-fb Feb 23, 2023
16ea0d6
Fix formatting in Modules/gcmodule.c
jbower-fb Feb 23, 2023
369e199
Simplify test in Modules/_testcapimodule.c
jbower-fb Feb 23, 2023
219154a
Address minor review comments and add documentation.
jbower-fb Feb 23, 2023
be5b7f0
Merge branch 'main' into gcvisitobjs
jbower-fb Feb 24, 2023
5752f1c
Update Doc/c-api/gcsupport.rst
jbower-fb Mar 11, 2023
1512004
Update Modules/_testcapimodule.c
jbower-fb Mar 11, 2023
87a5b56
Update Modules/_testcapimodule.c
jbower-fb Mar 11, 2023
295f7dd
Minor doc tweaks from review
jbower-fb Mar 11, 2023
ed06dff
Merge branch 'python:main' into gcvisitobjs
jbower-fb Mar 11, 2023
620043b
Merge branch 'main' into gcvisitobjs
jbower-fb Mar 13, 2023
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
Minor doc tweaks from review
  • Loading branch information
jbower-fb committed Mar 11, 2023
commit 295f7dd77e83e04617f7183e2e83d821b4526419
10 changes: 5 additions & 5 deletions Doc/c-api/gcsupport.rst
Original file line number Diff line number Diff line change
Expand Up @@ -238,13 +238,13 @@ the garbage collector.

.. c:function:: void PyUnstable_GC_VisitObjects(gcvisitobjects_t callback, void *arg)

Run supplied callback on all live GC-capable objects.
Run supplied *callback* on all live GC-capable objects. *arg* is passed through to
all invocations of *callback*.

.. warning::
If new objects are (de)allocated by the callback it is undefined if they
will be visited.

.. warning::
Garbage collection is disabled during operation. Explicitly running a collection
in the callback may lead to undefined behaviour e.g. visiting the same objects
multiple times or not at all.
Comment thread
jbower-fb marked this conversation as resolved.
Expand All @@ -254,9 +254,9 @@ the garbage collector.
.. c:type:: int (*gcvisitobjects_t)(PyObject *object, void *arg)

Type of the visitor function to be passed to :c:func:`PyUnstable_GC_VisitObjects`.
``arg`` is the same as passed to ``PyUnstable_GC_VisitObjects``. Returning ``0``
allows iteration to continue, returning ``1`` stops further iteration. Returning any
other value has undefined behavior.
*arg* is the same as the *arg* passed to ``PyUnstable_GC_VisitObjects``.
Return ``0`` to continue iteration, return ``1`` to stop iteration. Other return
values are reserved for now so behavior on returning anything else is undefined.

.. versionadded:: 3.12

Expand Down