]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.12] gh-102304: Fix Py_INCREF() stable ABI in debug mode (#104763) (#105352)
authorVictor Stinner <vstinner@python.org>
Tue, 6 Jun 2023 14:22:04 +0000 (16:22 +0200)
committerGitHub <noreply@github.com>
Tue, 6 Jun 2023 14:22:04 +0000 (16:22 +0200)
commit2bbb557b0f077f8c8b571148e0368472bbbbf5ea
tree464a18207f80280fd3e3bc4e0a50875d0ecb9cd9
parent2d9ead219e940d3fd717cdb0841cfe8a97efe554
[3.12] gh-102304: Fix Py_INCREF() stable ABI in debug mode (#104763) (#105352)

gh-102304: Fix Py_INCREF() stable ABI in debug mode (#104763)

When Python is built in debug mode (if the Py_REF_DEBUG macro is
defined), the Py_INCREF() and Py_DECREF() function are now always
implemented as opaque functions to avoid leaking implementation
details like the "_Py_RefTotal" variable or the
_Py_DecRefTotal_DO_NOT_USE_THIS() function.

* Remove _Py_IncRefTotal_DO_NOT_USE_THIS() and
  _Py_DecRefTotal_DO_NOT_USE_THIS() from the stable ABI.
* Remove _Py_NegativeRefcount() from limited C API.

(cherry picked from commit 92022d8416d9e175800b65c4d71d4e4fb47adcb0)
Doc/whatsnew/3.12.rst
Include/object.h
Lib/test/test_stable_abi_ctypes.py
Misc/stable_abi.toml
PC/python3dll.c