mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
gh-100758: Refactor initialisation of frame headers into a single function (_PyFrame_Initialize) (GH-100759)
This commit is contained in:
parent
78068126a1
commit
15c44789bb
5 changed files with 21 additions and 53 deletions
|
@ -1011,12 +1011,9 @@ static void
|
|||
init_frame(_PyInterpreterFrame *frame, PyFunctionObject *func, PyObject *locals)
|
||||
{
|
||||
PyCodeObject *code = (PyCodeObject *)func->func_code;
|
||||
_PyFrame_InitializeSpecials(frame, (PyFunctionObject*)Py_NewRef(func),
|
||||
Py_XNewRef(locals), code);
|
||||
_PyFrame_Initialize(frame, (PyFunctionObject*)Py_NewRef(func),
|
||||
Py_XNewRef(locals), code, 0);
|
||||
frame->previous = NULL;
|
||||
for (Py_ssize_t i = 0; i < code->co_nlocalsplus; i++) {
|
||||
frame->localsplus[i] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
PyFrameObject*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue