Mercurial > cpython-lru_cache-weakref
diff Include/code.h @ 70987:c5b0585624ef
map cells to arg slots at code creation time (closes #12399)
This removes nested loops in PyEval_EvalCodeEx.
| author | Benjamin Peterson <benjamin@python.org> |
|---|---|
| date | Sat, 25 Jun 2011 22:54:45 -0500 |
| parents | 3c9232a684ae |
| children |
line wrap: on
line diff
--- a/Include/code.h Sat Jun 25 20:30:52 2011 +0300 +++ b/Include/code.h Sat Jun 25 22:54:45 2011 -0500 @@ -22,6 +22,7 @@ PyObject *co_freevars; /* tuple of strings (free variable names) */ PyObject *co_cellvars; /* tuple of strings (cell variable names) */ /* The rest doesn't count for hash or comparisons */ + unsigned char *co_cell2arg; /* Maps cell vars which are arguments. */ PyObject *co_filename; /* unicode (where it was loaded from) */ PyObject *co_name; /* unicode (name, for reference) */ int co_firstlineno; /* first source line number */ @@ -57,6 +58,11 @@ #define CO_FUTURE_BARRY_AS_BDFL 0x40000 +/* This value is found in the co_cell2arg array when the associated cell + variable does not correspond to an argument. The maximum number of + arguments is 255 (indexed up to 254), so 255 work as a special flag.*/ +#define CO_CELL_NOT_AN_ARG 255 + /* This should be defined if a future statement modifies the syntax. For example, when a keyword is added. */
