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
Remove from Limited API
  • Loading branch information
jbower-fb committed Feb 18, 2023
commit 447bb538a3e1f9c20cdf68309b60adbc534c092f
3 changes: 3 additions & 0 deletions Include/objimpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,15 @@ PyAPI_FUNC(int) PyGC_Enable(void);
PyAPI_FUNC(int) PyGC_Disable(void);
PyAPI_FUNC(int) PyGC_IsEnabled(void);


#if !defined(Py_LIMITED_API)
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.

You can put this in Include/cpython/objimpl.h, which is only included for non-limited API. But that's not a blocker.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm not very familiar with the conventions here, is that what we should do with public API (even if it's unstable)?

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.

/* Visit all live GC-capable objects, similar to gc.get_objects(None).
*
* Users should avoid allocating or deallocating objects on the Python heap in
* the callback. */
typedef void (*gcvisitobjects_t)(PyObject*, void*);
PyAPI_FUNC(void) PyGC_VisitObjects(gcvisitobjects_t callback, void* arg);
#endif

/* Test if a type has a GC head */
#define PyType_IS_GC(t) PyType_HasFeature((t), Py_TPFLAGS_HAVE_GC)
Expand Down