Skip to content

Conversation

markshannon
Copy link
Member

@markshannon markshannon commented Jan 21, 2025

Changes the tow functions _PyTuple_FromStackRefSteal and _PyList_FromStackRefSteal to only steal references on success.
This makes the functions non-escaping as they only close any references if they fail.

The resulting API is a bit awkward, but as it is used it so few places that shouldn't be a problem.

@iritkatriel
Copy link
Member

I'd run the refleaks tests before merging.

@markshannon markshannon added the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label Jan 21, 2025
@markshannon markshannon merged commit 470a0a6 into python:main Jan 22, 2025
74 checks passed
@markshannon markshannon deleted the escaping-decref-4 branch January 22, 2025 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants