summaryrefslogtreecommitdiff
path: root/Objects/typeobject.c
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2021-05-21 10:57:35 +0100
committerGitHub <noreply@github.com>2021-05-21 10:57:35 +0100
commitb11a951f16f0603d98de24fee5c023df83ea552c (patch)
tree82e7807515db0e284d9ebc3b8c3ba6ff08699ea5 /Objects/typeobject.c
parentbe4dd7fcd93ed29d362c4bbcc48151bc619d6595 (diff)
downloadcpython-git-b11a951f16f0603d98de24fee5c023df83ea552c.tar.gz
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 'Objects/typeobject.c')
-rw-r--r--Objects/typeobject.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index e511cf9ebf..84be0a1a2f 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -8836,14 +8836,14 @@ super_init_without_args(PyFrameObject *f, PyCodeObject *co,
return -1;
}
- PyObject *obj = f->f_localsplus[0];
+ PyObject *obj = f->f_localsptr[0];
Py_ssize_t i, n;
if (obj == NULL && co->co_cell2arg) {
/* The first argument might be a cell. */
n = PyTuple_GET_SIZE(co->co_cellvars);
for (i = 0; i < n; i++) {
if (co->co_cell2arg[i] == 0) {
- PyObject *cell = f->f_localsplus[co->co_nlocals + i];
+ PyObject *cell = f->f_localsptr[co->co_nlocals + i];
assert(PyCell_Check(cell));
obj = PyCell_GET(cell);
break;
@@ -8871,7 +8871,7 @@ super_init_without_args(PyFrameObject *f, PyCodeObject *co,
if (_PyUnicode_EqualToASCIIId(name, &PyId___class__)) {
Py_ssize_t index = co->co_nlocals +
PyTuple_GET_SIZE(co->co_cellvars) + i;
- PyObject *cell = f->f_localsplus[index];
+ PyObject *cell = f->f_localsptr[index];
if (cell == NULL || !PyCell_Check(cell)) {
PyErr_SetString(PyExc_RuntimeError,
"super(): bad __class__ cell");