diff options
Diffstat (limited to 'Modules/gcmodule.c')
-rw-r--r-- | Modules/gcmodule.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c index 1bc41fb..1754182 100644 --- a/Modules/gcmodule.c +++ b/Modules/gcmodule.c @@ -2312,3 +2312,21 @@ PyObject_GC_Del(void *op) } PyObject_FREE(g); } + +int +PyObject_GC_IsTracked(PyObject* obj) +{ + if (PyObject_IS_GC(obj) && _PyObject_GC_IS_TRACKED(obj)) { + return 1; + } + return 0; +} + +int +PyObject_GC_IsFinalized(PyObject *obj) +{ + if (PyObject_IS_GC(obj) && _PyGCHead_FINALIZED(AS_GC(obj))) { + return 1; + } + return 0; +} |