]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-139103: Use borrowed references for positional args in _PyStack_UnpackDict (gh...
authorSam Gross <colesbury@gmail.com>
Tue, 3 Feb 2026 17:24:35 +0000 (12:24 -0500)
committerGitHub <noreply@github.com>
Tue, 3 Feb 2026 17:24:35 +0000 (12:24 -0500)
commit79c43e7c249e61d959550c20f798a88c8829a8a8
tree1d37b86f832c29055777532feca3a7d94ed6b872
parent53fecbe6e116a4426058b7d0f6c451719c72cb5b
gh-139103: Use borrowed references for positional args in _PyStack_UnpackDict (gh-144407)

The positional arguments passed to _PyStack_UnpackDict are already
kept alive by the caller, so we can avoid the extra reference count
operations by using borrowed references instead of creating new ones.

This reduces reference count contention in the free-threaded build
when calling functions with keyword arguments. In particular, this
avoids contention on the type argument to `__new__` when instantiating
namedtuples with keyword arguments.
Objects/call.c
Python/ceval.c