summaryrefslogtreecommitdiffstats
path: root/Include/cpython/code.h
diff options
context:
space:
mode:
Diffstat (limited to 'Include/cpython/code.h')
-rw-r--r--Include/cpython/code.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/Include/cpython/code.h b/Include/cpython/code.h
index 7ce6902..893ff93 100644
--- a/Include/cpython/code.h
+++ b/Include/cpython/code.h
@@ -32,6 +32,13 @@ typedef uint16_t _Py_CODEUNIT;
#define _Py_SET_OPCODE(word, opcode) \
do { ((unsigned char *)&(word))[0] = (opcode); } while (0)
+typedef struct {
+ PyObject *_co_code;
+ PyObject *_co_varnames;
+ PyObject *_co_cellvars;
+ PyObject *_co_freevars;
+} _PyCoCached;
+
// To avoid repeating ourselves in deepfreeze.py, all PyCodeObject members are
// defined in this macro:
#define _PyCode_DEF(SIZE) { \
@@ -90,7 +97,7 @@ typedef uint16_t _Py_CODEUNIT;
PyObject *co_qualname; /* unicode (qualname, for reference) */ \
PyObject *co_linetable; /* bytes object that holds location info */ \
PyObject *co_weakreflist; /* to support weakrefs to code objects */ \
- PyObject *_co_code; /* cached co_code object/attribute */ \
+ _PyCoCached *_co_cached; /* cached co_* attributes */ \
int _co_firsttraceable; /* index of first traceable instruction */ \
char *_co_linearray; /* array of line offsets */ \
/* Scratch space for extra data relating to the code object. \