mirror of
https://github.com/python/cpython.git
synced 2025-08-27 12:16:04 +00:00
gh-117139: Add _PyTuple_FromStackRefSteal and use it (#121244)
Avoids the extra conversion from stack refs to PyObjects.
This commit is contained in:
parent
1ac273224a
commit
8e8d202f55
8 changed files with 28 additions and 33 deletions
|
@ -1500,13 +1500,7 @@ initialize_locals(PyThreadState *tstate, PyFunctionObject *func,
|
|||
u = (PyObject *)&_Py_SINGLETON(tuple_empty);
|
||||
}
|
||||
else {
|
||||
assert(args != NULL);
|
||||
STACKREFS_TO_PYOBJECTS((_PyStackRef *)args, argcount, args_o);
|
||||
if (args_o == NULL) {
|
||||
goto fail_pre_positional;
|
||||
}
|
||||
u = _PyTuple_FromArraySteal((args_o + n), argcount - n);
|
||||
STACKREFS_TO_PYOBJECTS_CLEANUP(args_o);
|
||||
u = _PyTuple_FromStackRefSteal(args + n, argcount - n);
|
||||
}
|
||||
if (u == NULL) {
|
||||
goto fail_post_positional;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue