summaryrefslogtreecommitdiffstats
path: root/Include/internal/pycore_frame.h
diff options
context:
space:
mode:
Diffstat (limited to 'Include/internal/pycore_frame.h')
-rw-r--r--Include/internal/pycore_frame.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/Include/internal/pycore_frame.h b/Include/internal/pycore_frame.h
index 7e63f58..b025ca0 100644
--- a/Include/internal/pycore_frame.h
+++ b/Include/internal/pycore_frame.h
@@ -152,6 +152,21 @@ _PyFrame_LocalsToFast(InterpreterFrame *frame, int clear);
InterpreterFrame *_PyThreadState_PushFrame(
PyThreadState *tstate, PyFrameConstructor *con, PyObject *locals);
+extern InterpreterFrame *
+_PyThreadState_BumpFramePointerSlow(PyThreadState *tstate, size_t size);
+
+static inline InterpreterFrame *
+_PyThreadState_BumpFramePointer(PyThreadState *tstate, size_t size)
+{
+ PyObject **base = tstate->datastack_top;
+ PyObject **top = base + size;
+ if (top < tstate->datastack_limit) {
+ tstate->datastack_top = top;
+ return (InterpreterFrame *)base;
+ }
+ return _PyThreadState_BumpFramePointerSlow(tstate, size);
+}
+
void _PyThreadState_PopFrame(PyThreadState *tstate, InterpreterFrame *frame);
#ifdef __cplusplus