summaryrefslogtreecommitdiffstats
path: root/Python/_warnings.c
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2021-05-21 09:57:35 (GMT)
committerGitHub <noreply@github.com>2021-05-21 09:57:35 (GMT)
commitb11a951f16f0603d98de24fee5c023df83ea552c (patch)
tree82e7807515db0e284d9ebc3b8c3ba6ff08699ea5 /Python/_warnings.c
parentbe4dd7fcd93ed29d362c4bbcc48151bc619d6595 (diff)
downloadcpython-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 'Python/_warnings.c')
-rw-r--r--Python/_warnings.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/_warnings.c b/Python/_warnings.c
index 2c9a2a7..9c8815c 100644
--- a/Python/_warnings.c
+++ b/Python/_warnings.c
@@ -5,6 +5,7 @@
#include "pycore_pyerrors.h"
#include "pycore_pystate.h" // _PyThreadState_GET()
#include "frameobject.h" // PyFrame_GetBack()
+#include "pycore_frame.h"
#include "clinic/_warnings.c.h"
#define MODULE_NAME "_warnings"
@@ -853,7 +854,7 @@ setup_context(Py_ssize_t stack_level, PyObject **filename, int *lineno,
*lineno = 1;
}
else {
- globals = f->f_globals;
+ globals = _PyFrame_GetGlobals(f);
PyCodeObject *code = PyFrame_GetCode(f);
*filename = code->co_filename;
Py_DECREF(code);