1#ifndef Py_INTERNAL_CODE_H
2#define Py_INTERNAL_CODE_H
3#ifdef __cplusplus
4extern "C" {
5#endif
6
7typedef struct {
8 PyObject *ptr; /* Cached pointer (borrowed reference) */
9 uint64_t globals_ver; /* ma_version of global dict */
10 uint64_t builtins_ver; /* ma_version of builtin dict */
11} _PyOpcache_LoadGlobal;
12
13typedef struct {
14 PyTypeObject *type;
15 Py_ssize_t hint;
16 unsigned int tp_version_tag;
17} _PyOpCodeOpt_LoadAttr;
18
19struct _PyOpcache {
20 union {
21 _PyOpcache_LoadGlobal lg;
22 _PyOpCodeOpt_LoadAttr la;
23 } u;
24 char optimized;
25};
26
27/* Private API */
28int _PyCode_InitOpcache(PyCodeObject *co);
29
30
31#ifdef __cplusplus
32}
33#endif
34#endif /* !Py_INTERNAL_CODE_H */
35