]> granicus.if.org Git - python/commitdiff
Add co_stacksize field to codeobject structure, and stacksize argument
authorGuido van Rossum <guido@python.org>
Fri, 17 Jan 1997 20:59:26 +0000 (20:59 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 17 Jan 1997 20:59:26 +0000 (20:59 +0000)
to PyCode_New() argument list.  Also add CO_MAXBLOCKS constant
indicating the maximum static nesting supported by the compiler.

Include/compile.h

index 831e5dd68e757b9c64e9df8a98e183c5de8891c3..9be5c85174515970d29839cb3f2dc4c3f904af93 100644 (file)
@@ -42,6 +42,7 @@ typedef struct {
        PyObject_HEAD
        int co_argcount;        /* #arguments, except *args */
        int co_nlocals;         /* #local variables */
+       int co_stacksize;       /* #entries needed for evaluation stack */
        int co_flags;           /* CO_..., see below */
        PyStringObject *co_code; /* instruction opcodes */
        PyObject *co_consts;    /* list (constants used) */
@@ -62,12 +63,13 @@ extern DL_IMPORT(PyTypeObject) PyCode_Type;
 
 #define PyCode_Check(op) ((op)->ob_type == &PyCode_Type)
 
+#define CO_MAXBLOCKS 20 /* Max static block nesting within a function */
 
 /* Public interface */
 struct _node; /* Declare the existence of this type */
 PyCodeObject *PyNode_Compile Py_PROTO((struct _node *, char *));
 PyCodeObject *PyCode_New Py_PROTO((
-       int, int, int, PyObject *, PyObject *, PyObject *, PyObject *,
+       int, int, int, int, PyObject *, PyObject *, PyObject *, PyObject *,
        PyObject *, PyObject *)); /* same as struct above */
 
 #ifdef __cplusplus