# Reference Counting

The macros in this section are used for managing reference counts of Python objects.

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, as well as the global variable :c:data:_Py_RefTotal.