Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-128682: Change a couple of functions to only steal references on success. #129132

Merged
merged 1 commit into from
Jan 22, 2025

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