Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3f6e408

Browse files
committed
Add co_stacksize field to codeobject structure, and stacksize argument
to PyCode_New() argument list. Also add CO_MAXBLOCKS constant indicating the maximum static nesting supported by the compiler.
1 parent 00f86e6 commit 3f6e408

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Include/compile.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ typedef struct {
4242
PyObject_HEAD
4343
int co_argcount; /* #arguments, except *args */
4444
int co_nlocals; /* #local variables */
45+
int co_stacksize; /* #entries needed for evaluation stack */
4546
int co_flags; /* CO_..., see below */
4647
PyStringObject *co_code; /* instruction opcodes */
4748
PyObject *co_consts; /* list (constants used) */
@@ -62,12 +63,13 @@ extern DL_IMPORT(PyTypeObject) PyCode_Type;
6263

6364
#define PyCode_Check(op) ((op)->ob_type == &PyCode_Type)
6465

66+
#define CO_MAXBLOCKS 20 /* Max static block nesting within a function */
6567

6668
/* Public interface */
6769
struct _node; /* Declare the existence of this type */
6870
PyCodeObject *PyNode_Compile Py_PROTO((struct _node *, char *));
6971
PyCodeObject *PyCode_New Py_PROTO((
70-
int, int, int, PyObject *, PyObject *, PyObject *, PyObject *,
72+
int, int, int, int, PyObject *, PyObject *, PyObject *, PyObject *,
7173
PyObject *, PyObject *)); /* same as struct above */
7274

7375
#ifdef __cplusplus

0 commit comments

Comments
 (0)