aboutsummaryrefslogtreecommitdiff
path: root/Include/objimpl.h
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2020-04-11 01:21:54 +0100
committerGitHub <noreply@github.com>2020-04-11 01:21:54 +0100
commitf13072b8a89a922285737988b086beb4b06c6648 (patch)
tree14b73d6eb614949e2ce81db59f13c3b13eb475d9 /Include/objimpl.h
parent0361556537686f857f1025ead75e6af4ca7cc94a (diff)
downloadcpython3-f13072b8a89a922285737988b086beb4b06c6648.tar.gz
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/objimpl.h')
-rw-r--r--Include/objimpl.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/Include/objimpl.h b/Include/objimpl.h
index 6e7549c90d..030d7eee29 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