summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2020-04-11 00:21:54 (GMT)
committerGitHub <noreply@github.com>2020-04-11 00:21:54 (GMT)
commitf13072b8a89a922285737988b086beb4b06c6648 (patch)
tree14b73d6eb614949e2ce81db59f13c3b13eb475d9 /Include
parent0361556537686f857f1025ead75e6af4ca7cc94a (diff)
downloadcpython-f13072b8a89a922285737988b086beb4b06c6648.zip
cpython-f13072b8a89a922285737988b086beb4b06c6648.tar.gz
cpython-f13072b8a89a922285737988b086beb4b06c6648.tar.bz2
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.
Diffstat (limited to 'Include')
-rw-r--r--Include/objimpl.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/Include/objimpl.h b/Include/objimpl.h
index 6e7549c..030d7ee 100644
--- a/Include/objimpl.h
+++ b/Include/objimpl.h
@@ -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