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