Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

gh-91755: Document Py_IncRef and Py_DecRef as C function. #91805

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 18, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
gh-91755: Document Py_IncRef and Py_DecRef as C function.
  • Loading branch information
CharlieZhao95 committed Apr 22, 2022
commit 50a0ce1da56e7cc9c19e0302ebb7b7e551f7658b
14 changes: 10 additions & 4 deletions 14 Doc/c-api/refcounting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:: Py_IncRef(PyObject *o)

:c:func:`Py_IncRef` is a simply exported function version of :c:func:`Py_XINCREF`,
which provides conveniences for runtime dynamic embedding of Python.
erlend-aasland marked this conversation as resolved.
Show resolved Hide resolved


.. c:function:: Py_DecRef(PyObject *o)

:c:func:`Py_DecRef` is a simply exported function version of :c:func:`Py_XDECREF`,
which provides conveniences for runtime dynamic embedding of Python.
erlend-aasland marked this conversation as resolved.
Show resolved Hide resolved

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`,
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.