SIGN IN SIGN UP

gh-100146: Steal references from stack when building a list (#100147)

When executing the BUILD_LIST opcode, steal the references from the stack,
in a manner similar to the BUILD_TUPLE opcode.  Implement this by offloading
the logic to a new private API, _PyList_FromArraySteal(), that works similarly
to _PyTuple_FromArraySteal().

This way, instead of performing multiple stack pointer adjustments while the
list is being initialized, the stack is adjusted only once and a fast memory
copy operation is performed in one fell swoop.
L
L. A. F. Pereira committed
e6d44407827490a5345e8393fbdc78fd6c14f5b1
Parent: b3722ca
Committed by GitHub <noreply@github.com> on 1/3/2023, 6:49:49 PM