2023-03-20 13:03:04 -03:00
|
|
|
#ifndef Py_INTERNAL_OBJECT_STATE_H
|
|
|
|
#define Py_INTERNAL_OBJECT_STATE_H
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef Py_BUILD_CORE
|
|
|
|
# error "this header requires Py_BUILD_CORE define"
|
|
|
|
#endif
|
|
|
|
|
2024-07-22 13:08:27 -03:00
|
|
|
#include "pycore_freelist_state.h" // _Py_freelists
|
|
|
|
#include "pycore_hashtable.h" // _Py_hashtable_t
|
2023-08-31 13:33:34 -03:00
|
|
|
|
2023-03-20 13:03:04 -03:00
|
|
|
struct _py_object_runtime_state {
|
2023-03-21 14:46:09 -03:00
|
|
|
#ifdef Py_REF_DEBUG
|
|
|
|
Py_ssize_t interpreter_leaks;
|
|
|
|
#endif
|
2023-08-03 16:51:08 -03:00
|
|
|
int _not_used;
|
2023-03-21 14:46:09 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _py_object_state {
|
2024-02-13 20:32:51 -04:00
|
|
|
#if !defined(Py_GIL_DISABLED)
|
2024-07-22 13:08:27 -03:00
|
|
|
struct _Py_freelists freelists;
|
2024-02-13 20:32:51 -04:00
|
|
|
#endif
|
2023-03-20 13:03:04 -03:00
|
|
|
#ifdef Py_REF_DEBUG
|
|
|
|
Py_ssize_t reftotal;
|
|
|
|
#endif
|
2023-08-03 16:51:08 -03:00
|
|
|
#ifdef Py_TRACE_REFS
|
2023-08-31 13:33:34 -03:00
|
|
|
// Hash table storing all objects. The key is the object pointer
|
|
|
|
// (PyObject*) and the value is always the number 1 (as uintptr_t).
|
|
|
|
// See _PyRefchain_IsTraced() and _PyRefchain_Trace() functions.
|
|
|
|
_Py_hashtable_t *refchain;
|
2023-08-03 16:51:08 -03:00
|
|
|
#endif
|
|
|
|
int _not_used;
|
2023-03-20 13:03:04 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif /* !Py_INTERNAL_OBJECT_STATE_H */
|