[Python-checkins] CVS: python/dist/src/Include frameobject.h,2.29,2.30
Jeremy Hylton
jhylton@users.sourceforge.net
Mon, 29 Jan 2001 14:51:54 -0800
Update of /cvsroot/python/python/dist/src/Include
In directory usw-pr-cvs1:/tmp/cvs-serv27579/Include
Modified Files:
frameobject.h
Log Message:
Remove f_closure slot of frameobject and use f_localsplus instead.
This change eliminates an extra malloc/free when a frame with free
variables is created. Any cell vars or free vars are stored in
f_localsplus after the locals and before the stack.
eval_code2() fills in the appropriate values after handling
initialization of locals.
To track the size the frame has an f_size member that tracks the total
size of f_localsplus. It used to be implicitly f_nlocals + f_stacksize.
Index: frameobject.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/frameobject.h,v
retrieving revision 2.29
retrieving revision 2.30
diff -C2 -r2.29 -r2.30
*** frameobject.h 2001/01/25 20:06:58 2.29
--- frameobject.h 2001/01/29 22:51:52 2.30
***************
*** 21,25 ****
PyObject *f_globals; /* global symbol table (PyDictObject) */
PyObject *f_locals; /* local symbol table (PyDictObject) */
- PyObject *f_closure; /* environment for free variables */
PyObject **f_valuestack; /* points after the last local */
PyObject *f_trace; /* Trace function */
--- 21,24 ----
***************
*** 32,36 ****
--- 31,38 ----
int f_iblock; /* index in f_blockstack */
PyTryBlock f_blockstack[CO_MAXBLOCKS]; /* for try and loop blocks */
+ int f_size; /* size of localsplus */
int f_nlocals; /* number of locals */
+ int f_ncells;
+ int f_nfreevars;
int f_stacksize; /* size of value stack */
PyObject *f_localsplus[1]; /* locals+stack, dynamically sized */