diff options
author | Victor Stinner <vstinner@python.org> | 2023-06-06 14:22:04 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-06 14:22:04 (GMT) |
commit | 2bbb557b0f077f8c8b571148e0368472bbbbf5ea (patch) | |
tree | 464a18207f80280fd3e3bc4e0a50875d0ecb9cd9 /Doc/whatsnew | |
parent | 2d9ead219e940d3fd717cdb0841cfe8a97efe554 (diff) | |
download | cpython-2bbb557b0f077f8c8b571148e0368472bbbbf5ea.zip cpython-2bbb557b0f077f8c8b571148e0368472bbbbf5ea.tar.gz cpython-2bbb557b0f077f8c8b571148e0368472bbbbf5ea.tar.bz2 |
[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)
Diffstat (limited to 'Doc/whatsnew')
-rw-r--r-- | Doc/whatsnew/3.12.rst | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst index 287549f..4a75597 100644 --- a/Doc/whatsnew/3.12.rst +++ b/Doc/whatsnew/3.12.rst @@ -1535,6 +1535,15 @@ Build Changes :file:`!configure`. (Contributed by Christian Heimes in :gh:`89886`.) +* C extensions built with the :ref:`limited C API <limited-c-api>` + on :ref:`Python build in debug mode <debug-build>` no longer support Python + 3.9 and older. In this configuration, :c:func:`Py_INCREF` and + :c:func:`Py_DECREF` are now always implemented as opaque function calls, + but the called functions were added to Python 3.10. Build C extensions + with a release build of Python or with Python 3.12 and older, to keep support + for Python 3.9 and older. + (Contributed by Victor Stinner in :gh:`102304`.) + C API Changes ============= |