diff options
author | Mark Shannon <mark@hotpy.org> | 2021-05-21 09:57:35 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-21 09:57:35 (GMT) |
commit | b11a951f16f0603d98de24fee5c023df83ea552c (patch) | |
tree | 82e7807515db0e284d9ebc3b8c3ba6ff08699ea5 /Include/cpython/pystate.h | |
parent | be4dd7fcd93ed29d362c4bbcc48151bc619d6595 (diff) | |
download | cpython-b11a951f16f0603d98de24fee5c023df83ea552c.zip cpython-b11a951f16f0603d98de24fee5c023df83ea552c.tar.gz cpython-b11a951f16f0603d98de24fee5c023df83ea552c.tar.bz2 |
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.
Diffstat (limited to 'Include/cpython/pystate.h')
-rw-r--r-- | Include/cpython/pystate.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Include/cpython/pystate.h b/Include/cpython/pystate.h index e3ccc54..63ba600 100644 --- a/Include/cpython/pystate.h +++ b/Include/cpython/pystate.h @@ -57,6 +57,12 @@ typedef struct _err_stackitem { } _PyErr_StackItem; +typedef struct _stack_chunk { + struct _stack_chunk *previous; + size_t size; + size_t top; + PyObject * data[1]; /* Variable sized */ +} _PyStackChunk; // The PyThreadState typedef is in Include/pystate.h. struct _ts { @@ -149,6 +155,9 @@ struct _ts { CFrame root_cframe; + _PyStackChunk *datastack_chunk; + PyObject **datastack_top; + PyObject **datastack_limit; /* XXX signal handlers should also be here */ }; |