codekingpro/portable-devtools
114k
1#ifndef Py_INTERNAL_OBJECT_DEFERRED_H2#define Py_INTERNAL_OBJECT_DEFERRED_H3 4#ifdef __cplusplus5extern "C" {6#endif7 8#include "pycore_gc.h"9 10#ifndef Py_BUILD_CORE11# error "this header requires Py_BUILD_CORE define"12#endif13 14// Mark an object as supporting deferred reference counting. This is a no-op15// in the default (with GIL) build. Objects that use deferred reference16// counting should be tracked by the GC so that they are eventually collected.17extern void _PyObject_SetDeferredRefcount(PyObject *op);18 19static inline int20_PyObject_HasDeferredRefcount(PyObject *op)21{22#ifdef Py_GIL_DISABLED23 return _PyObject_HAS_GC_BITS(op, _PyGC_BITS_DEFERRED);24#else25 return 0;26#endif27}28 29#ifdef __cplusplus30}31#endif32#endif // !Py_INTERNAL_OBJECT_DEFERRED_H33 