1 #ifndef Py_INTERNAL_OBJECT_STATE_H 2 #define Py_INTERNAL_OBJECT_STATE_H 3 #ifdef __cplusplus 4 extern "C" { 5 #endif 6 7 #ifndef Py_BUILD_CORE 8 # error "this header requires Py_BUILD_CORE define" 9 #endif 10 11 #include "pycore_freelist.h" // _PyObject_freelists 12 #include "pycore_hashtable.h" // _Py_hashtable_t 13 14 struct _py_object_runtime_state { 15 #ifdef Py_REF_DEBUG 16 Py_ssize_t interpreter_leaks; 17 #endif 18 int _not_used; 19 }; 20 21 struct _py_object_state { 22 #if !defined(Py_GIL_DISABLED) 23 struct _Py_object_freelists freelists; 24 #endif 25 #ifdef Py_REF_DEBUG 26 Py_ssize_t reftotal; 27 #endif 28 #ifdef Py_TRACE_REFS 29 // Hash table storing all objects. The key is the object pointer 30 // (PyObject*) and the value is always the number 1 (as uintptr_t). 31 // See _PyRefchain_IsTraced() and _PyRefchain_Trace() functions. 32 _Py_hashtable_t *refchain; 33 #endif 34 int _not_used; 35 }; 36 37 38 #ifdef __cplusplus 39 } 40 #endif 41 #endif /* !Py_INTERNAL_OBJECT_STATE_H */ 42