summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorCharlie Zhao <zhaoyu_hit@qq.com>2022-05-18 08:42:05 (GMT)
committerGitHub <noreply@github.com>2022-05-18 08:42:05 (GMT)
commit58a3d28039863b014f57a1ac93b51e20920ebe7b (patch)
tree36dc87b7129939ac1b5b06ceaa36b3e166348abf /Doc
parentb86d783a4eff96306f315acf9a6f1aca85d47fc3 (diff)
downloadcpython-58a3d28039863b014f57a1ac93b51e20920ebe7b.zip
cpython-58a3d28039863b014f57a1ac93b51e20920ebe7b.tar.gz
cpython-58a3d28039863b014f57a1ac93b51e20920ebe7b.tar.bz2
gh-91755: Document Py_IncRef and Py_DecRef as C functions (#91805)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Diffstat (limited to 'Doc')
-rw-r--r--Doc/c-api/refcounting.rst14
1 files changed, 10 insertions, 4 deletions
diff --git a/Doc/c-api/refcounting.rst b/Doc/c-api/refcounting.rst
index 391907c..738bd77 100644
--- a/Doc/c-api/refcounting.rst
+++ b/Doc/c-api/refcounting.rst
@@ -109,11 +109,17 @@ objects.
It is a good idea to use this macro whenever decrementing the reference
count of an object that might be traversed during garbage collection.
+.. c:function:: void Py_IncRef(PyObject *o)
+
+ Increment the reference count for object *o*. A function version of :c:func:`Py_XINCREF`.
+ It can be used for runtime dynamic embedding of Python.
+
+
+.. c:function:: void Py_DecRef(PyObject *o)
+
+ Decrement the reference count for object *o*. A function version of :c:func:`Py_XDECREF`.
+ It can be used for runtime dynamic embedding of Python.
-The following functions are for runtime dynamic embedding of Python:
-``Py_IncRef(PyObject *o)``, ``Py_DecRef(PyObject *o)``. They are
-simply exported function versions of :c:func:`Py_XINCREF` and
-:c:func:`Py_XDECREF`, respectively.
The following functions or macros are only for use within the interpreter core:
:c:func:`_Py_Dealloc`, :c:func:`_Py_ForgetReference`, :c:func:`_Py_NewReference`,