mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
bpo-40241: Add PyObject_GC_IsTracked and PyObject_GC_IsFinalized to the public C-API (GH-19461)
Add the functions PyObject_GC_IsTracked and PyObject_GC_IsFinalized to the public API to allow to query if Python objects are being currently tracked or have been already finalized by the garbage collector respectively.
This commit is contained in:
parent
0361556537
commit
f13072b8a8
6 changed files with 50 additions and 1 deletions
|
|
@ -186,6 +186,8 @@ PyAPI_FUNC(void) PyObject_GC_Del(void *);
|
|||
#define PyObject_GC_NewVar(type, typeobj, n) \
|
||||
( (type *) _PyObject_GC_NewVar((typeobj), (n)) )
|
||||
|
||||
PyAPI_FUNC(int) PyObject_GC_IsTracked(PyObject *);
|
||||
PyAPI_FUNC(int) PyObject_GC_IsFinalized(PyObject *);
|
||||
|
||||
/* Utility macro to help write tp_traverse functions.
|
||||
* To use this macro, the tp_traverse function must name its arguments
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue