Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-11-19 09:50:51

0001 #ifndef Py_INTERNAL_TSTATE_H
0002 #define Py_INTERNAL_TSTATE_H
0003 #ifdef __cplusplus
0004 extern "C" {
0005 #endif
0006 
0007 #ifndef Py_BUILD_CORE
0008 #  error "this header requires Py_BUILD_CORE define"
0009 #endif
0010 
0011 #include "pycore_brc.h"           // struct _brc_thread_state
0012 #include "pycore_freelist.h"      // struct _Py_freelist_state
0013 #include "pycore_mimalloc.h"      // struct _mimalloc_thread_state
0014 #include "pycore_qsbr.h"          // struct qsbr
0015 
0016 
0017 // Every PyThreadState is actually allocated as a _PyThreadStateImpl. The
0018 // PyThreadState fields are exposed as part of the C API, although most fields
0019 // are intended to be private. The _PyThreadStateImpl fields not exposed.
0020 typedef struct _PyThreadStateImpl {
0021     // semi-public fields are in PyThreadState.
0022     PyThreadState base;
0023 
0024     PyObject *asyncio_running_loop; // Strong reference
0025 
0026     struct _qsbr_thread_state *qsbr;  // only used by free-threaded build
0027     struct llist_node mem_free_queue; // delayed free queue
0028 
0029 #ifdef Py_GIL_DISABLED
0030     struct _gc_thread_state gc;
0031     struct _mimalloc_thread_state mimalloc;
0032     struct _Py_object_freelists freelists;
0033     struct _brc_thread_state brc;
0034 #endif
0035 
0036 #if defined(Py_REF_DEBUG) && defined(Py_GIL_DISABLED)
0037     Py_ssize_t reftotal;  // this thread's total refcount operations
0038 #endif
0039 
0040 } _PyThreadStateImpl;
0041 
0042 
0043 #ifdef __cplusplus
0044 }
0045 #endif
0046 #endif /* !Py_INTERNAL_TSTATE_H */