SIGN IN SIGN UP

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.
S
Sam Gross committed
79c43e7c249e61d959550c20f798a88c8829a8a8
Parent: 53fecbe
Committed by GitHub <noreply@github.com> on 2/3/2026, 5:24:35 PM