summaryrefslogtreecommitdiffstats
path: root/Doc/c-api
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-02-07 00:24:29 (GMT)
committerGitHub <noreply@github.com>2020-02-07 00:24:29 (GMT)
commitc86a11221df7e37da389f9c6ce6e47ea22dc44ff (patch)
treec27a35a01bde1554488268dd3bbeb8b4c46e193c /Doc/c-api
parenta93c51e3a8e15f1a486d11d5b55a64f3381babe0 (diff)
downloadcpython-c86a11221df7e37da389f9c6ce6e47ea22dc44ff.zip
cpython-c86a11221df7e37da389f9c6ce6e47ea22dc44ff.tar.gz
cpython-c86a11221df7e37da389f9c6ce6e47ea22dc44ff.tar.bz2
bpo-39573: Add Py_SET_REFCNT() function (GH-18389)
Add a Py_SET_REFCNT() function to set the reference counter of an object.
Diffstat (limited to 'Doc/c-api')
-rw-r--r--Doc/c-api/structures.rst7
1 files changed, 7 insertions, 0 deletions
diff --git a/Doc/c-api/structures.rst b/Doc/c-api/structures.rst
index 0c66138..100573c 100644
--- a/Doc/c-api/structures.rst
+++ b/Doc/c-api/structures.rst
@@ -79,6 +79,13 @@ the definition of all other Python objects.
(((PyObject*)(o))->ob_refcnt)
+.. c:function:: void Py_SET_REFCNT(PyObject *o, Py_ssize_t refcnt)
+
+ Set the object *o* reference counter to *refcnt*.
+
+ .. versionadded:: 3.9
+
+
.. c:macro:: Py_SIZE(o)
This macro is used to access the :attr:`ob_size` member of a Python object.