]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-128844: Make `_Py_TryIncref` public as an unstable API. (#128926)
authorSam Gross <colesbury@gmail.com>
Tue, 28 Jan 2025 19:32:27 +0000 (14:32 -0500)
committerGitHub <noreply@github.com>
Tue, 28 Jan 2025 19:32:27 +0000 (19:32 +0000)
commitd23f5701ad2a64c7877bb37258420c417357423e
tree8ea63a6f20b08d01c4fb6f1423abeb78e28e37df
parent7dd0a7e52ee832559b89d5ccba732c8e91260df8
gh-128844: Make `_Py_TryIncref` public as an unstable API. (#128926)

This exposes `_Py_TryIncref` as `PyUnstable_TryIncref()` and the helper
function `_PyObject_SetMaybeWeakref` as `PyUnstable_EnableTryIncRef`.

These are helpers for dealing with unowned references in a safe way,
particularly in the free threading build.

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Doc/c-api/object.rst
Include/cpython/object.h
Misc/NEWS.d/next/C_API/2025-01-16-21-56-49.gh-issue-128844.ZPiJuo.rst [new file with mode: 0644]
Modules/_testcapi/object.c
Objects/object.c
Tools/c-analyzer/cpython/ignored.tsv