1 #ifndef Py_INTERNAL_CONTEXT_H 2 #define Py_INTERNAL_CONTEXT_H 3 4 #ifndef Py_BUILD_CORE 5 # error "this header requires Py_BUILD_CORE define" 6 #endif 7 8 #include "pycore_hamt.h" /* PyHamtObject */ 9 10 struct _pycontextobject { 11 PyObject_HEAD 12 PyContext *ctx_prev; 13 PyHamtObject *ctx_vars; 14 PyObject *ctx_weakreflist; 15 int ctx_entered; 16 }; 17 18 19 struct _pycontextvarobject { 20 PyObject_HEAD 21 PyObject *var_name; 22 PyObject *var_default; 23 PyObject *var_cached; 24 uint64_t var_cached_tsid; 25 uint64_t var_cached_tsver; 26 Py_hash_t var_hash; 27 }; 28 29 30 struct _pycontexttokenobject { 31 PyObject_HEAD 32 PyContext *tok_ctx; 33 PyContextVar *tok_var; 34 PyObject *tok_oldval; 35 int tok_used; 36 }; 37 38 39 int _PyContext_Init(void); 40 void _PyContext_Fini(void); 41 42 #endif /* !Py_INTERNAL_CONTEXT_H */ 43