From b11a951f16f0603d98de24fee5c023df83ea552c Mon Sep 17 00:00:00 2001 From: Mark Shannon Date: Fri, 21 May 2021 10:57:35 +0100 Subject: bpo-44032: Move data stack to thread from FrameObject. (GH-26076) * Remove 'zombie' frames. We won't need them once we are allocating fixed-size frames. * Add co_nlocalplus field to code object to avoid recomputing size of locals + frees + cells. * Move locals, cells and freevars out of frame object into separate memory buffer. * Use per-threadstate allocated memory chunks for local variables. * Move globals and builtins from frame object to per-thread stack. * Move (slow) locals frame object to per-thread stack. * Move internal frame functions to internal header. --- Include/cpython/code.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Include/cpython/code.h') diff --git a/Include/cpython/code.h b/Include/cpython/code.h index 330f1f54d1..575a4b72b2 100644 --- a/Include/cpython/code.h +++ b/Include/cpython/code.h @@ -40,8 +40,8 @@ struct PyCodeObject { PyObject *co_name; /* unicode (name, for reference) */ PyObject *co_linetable; /* string (encoding addr<->lineno mapping) See Objects/lnotab_notes.txt for details. */ + int co_nlocalsplus; /* Number of locals + free + cell variables */ PyObject *co_exceptiontable; /* Byte string encoding exception handling table */ - void *co_zombieframe; /* for optimization only (see frameobject.c) */ PyObject *co_weakreflist; /* to support weakrefs to code objects */ /* Scratch space for extra data relating to the code object. Type is a void* to keep the format private in codeobject.c to force -- cgit v1.2.1