mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
bpo-45256: Rationalize code around Python-to-Python calls a bit. (GH-29235)
This commit is contained in:
parent
0a1a36b74b
commit
7f61d9d848
4 changed files with 121 additions and 70 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue