summaryrefslogtreecommitdiffstats
path: root/Doc/whatsnew
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2021-04-02 13:45:37 (GMT)
committerGitHub <noreply@github.com>2021-04-02 13:45:37 (GMT)
commit3359cab038968935b40344fad7c30d211f9692e4 (patch)
tree83d983230eac34582538556b7c50be688e900d1c /Doc/whatsnew
parent442ad74fc2928b095760eb89aba93c28eab17f9b (diff)
downloadcpython-3359cab038968935b40344fad7c30d211f9692e4.zip
cpython-3359cab038968935b40344fad7c30d211f9692e4.tar.gz
cpython-3359cab038968935b40344fad7c30d211f9692e4.tar.bz2
bpo-43688: Support the limited C API in debug mode (GH-25131)
The limited C API is now supported if Python is built in debug mode (if the Py_DEBUG macro is defined). In the limited C API, the Py_INCREF() and Py_DECREF() functions are now implemented as opaque function calls, rather than accessing directly the PyObject.ob_refcnt member, if Python is built in debug mode and the Py_LIMITED_API macro targets Python 3.10 or newer. It became possible to support the limited C API in debug mode because the PyObject structure is the same in release and debug mode since Python 3.8 (see bpo-36465). The limited C API is still not supported in the --with-trace-refs special build (Py_TRACE_REFS macro).
Diffstat (limited to 'Doc/whatsnew')
-rw-r--r--Doc/whatsnew/3.10.rst12
1 files changed, 12 insertions, 0 deletions
diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst
index a8ff567..b84bcf9 100644
--- a/Doc/whatsnew/3.10.rst
+++ b/Doc/whatsnew/3.10.rst
@@ -1315,6 +1315,18 @@ New Features
to simulate.
(Contributed by Antoine Pitrou in :issue:`43356`.)
+* The limited C API is now supported if Python is built in debug mode (if the
+ ``Py_DEBUG`` macro is defined). In the limited C API, the :c:func:`Py_INCREF`
+ and :c:func:`Py_DECREF` functions are now implemented as opaque function
+ calls, rather than accessing directly the :c:member:`PyObject.ob_refcnt`
+ member, if Python is built in debug mode and the ``Py_LIMITED_API`` macro
+ targets Python 3.10 or newer. It became possible to support the limited C API
+ in debug mode because the :c:type:`PyObject` structure is the same in release
+ and debug mode since Python 3.8 (see :issue:`36465`).
+
+ The limited C API is still not supported in the ``--with-trace-refs`` special
+ build (``Py_TRACE_REFS`` macro).
+ (Contributed by Victor Stinner in :issue:`43688`.)
Porting to Python 3.10
----------------------