https://github.com/python/cpython/commit/b538c2832d582a428a6f4ddc818680c5e05a0745 commit: b538c2832d582a428a6f4ddc818680c5e05a0745 branch: main author: Aaron Wieczorek <[email protected]> committer: Fidget-Spinner <[email protected]> date: 2026-01-02T20:43:00Z summary:
gh-143361: Pass PY_VECTORCALL_ARGUMENTS_OFFSET in _Py_CallBuiltinClass_StackRefSteal (GH-143367) Co-authored-by: Aaron Wieczorek <[email protected]> files: A Misc/NEWS.d/next/Core_and_Builtins/2026-01-02-17-11-16.gh-issue-143361.YDnvdC.rst M Python/ceval.c diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2026-01-02-17-11-16.gh-issue-143361.YDnvdC.rst b/Misc/NEWS.d/next/Core_and_Builtins/2026-01-02-17-11-16.gh-issue-143361.YDnvdC.rst new file mode 100644 index 00000000000000..df4e3b61c672cb --- /dev/null +++ b/Misc/NEWS.d/next/Core_and_Builtins/2026-01-02-17-11-16.gh-issue-143361.YDnvdC.rst @@ -0,0 +1,2 @@ +Add ``PY_VECTORCALL_ARGUMENTS_OFFSET`` to ``_Py_CallBuiltinClass_StackRefSteal`` to +avoid redundant allocations diff --git a/Python/ceval.c b/Python/ceval.c index 924afaa97443cb..d90ac5c69b9e81 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -1273,7 +1273,7 @@ _Py_CallBuiltinClass_StackRefSteal( goto cleanup; } PyTypeObject *tp = (PyTypeObject *)PyStackRef_AsPyObjectBorrow(callable); - res = tp->tp_vectorcall((PyObject *)tp, args_o, total_args, NULL); + res = tp->tp_vectorcall((PyObject *)tp, args_o, total_args | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); STACKREFS_TO_PYOBJECTS_CLEANUP(args_o); assert((res != NULL) ^ (PyErr_Occurred() != NULL)); cleanup: _______________________________________________ Python-checkins mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3//lists/python-checkins.python.org Member address: [email protected]
