FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[3.14] gh-140061: Use `_PyObject_IsUniquelyReferenced()` to check if objects are uniquely referenced (gh-140062) by miss-islington · Pull Request #140157 · python/cpython · GitHub

Repository navigation

[3.14] gh-140061: Use _PyObject_IsUniquelyReferenced() to check if objects are uniquely referenced (gh-140062) - #140157

Merged
colesbury merged 1 commit into
python:3.14from
miss-islington:backport-32c2649-3.14
Oct 15, 2025
Merged

colesbury merged 1 commit into
python:3.14from
miss-islington:backport-32c2649-3.14

Conversation

miss-islington commented Oct 15, 2025 •
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Contributor

The previous Py_REFCNT(x) == 1 checks can have data races in the free
threaded build. _PyObject_IsUniquelyReferenced(x) is a more conservative
check that is safe in the free threaded build and is identical to
Py_REFCNT(x) == 1 in the default GIL-enabled build.
(cherry picked from commit 32c2649)

Co-authored-by: Sergey Miryanov sergey.miryanov@gmail.com

…bjects are uniquely referenced (pythongh-140062)

The previous `Py_REFCNT(x) == 1` checks can have data races in the free
threaded build. `_PyObject_IsUniquelyReferenced(x)` is a more conservative
check that is safe in the free threaded build and is identical to
`Py_REFCNT(x) == 1` in the default GIL-enabled build.
(cherry picked from commit 32c2649)

Co-authored-by: Sergey Miryanov <sergey.miryanov@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL