Skip to content
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
Prev Previous commit
Add _Py_DEC_REFTOTAL() in pycore_object.h.
  • Loading branch information
ericsnowcurrently committed Mar 8, 2023
commit 240d1d5e8312778f9c2a9dc07cc4845ad6b90dbe
9 changes: 7 additions & 2 deletions Include/internal/pycore_object.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ PyAPI_DATA(Py_ssize_t) _Py_RefTotal;
extern void _Py_AddRefTotal(Py_ssize_t);
extern void _Py_IncRefTotal(void);
extern void _Py_DecRefTotal(void);
# define _Py_DEC_REFTOTAL() _Py_RefTotal--
#endif

// Increment reference count by n
Expand All @@ -63,7 +64,7 @@ _Py_DECREF_SPECIALIZED(PyObject *op, const destructor destruct)
{
_Py_DECREF_STAT_INC();
#ifdef Py_REF_DEBUG
_Py_RefTotal--;
_Py_DEC_REFTOTAL();
#endif
if (--op->ob_refcnt != 0) {
assert(op->ob_refcnt > 0);
Expand All @@ -81,7 +82,7 @@ _Py_DECREF_NO_DEALLOC(PyObject *op)
{
_Py_DECREF_STAT_INC();
#ifdef Py_REF_DEBUG
_Py_RefTotal--;
_Py_DEC_REFTOTAL();
#endif
op->ob_refcnt--;
#ifdef Py_DEBUG
Expand All @@ -91,6 +92,10 @@ _Py_DECREF_NO_DEALLOC(PyObject *op)
#endif
}

#ifdef Py_REF_DEBUG
# undef _Py_DEC_REFTOTAL
#endif


PyAPI_FUNC(int) _PyType_CheckConsistency(PyTypeObject *type);
PyAPI_FUNC(int) _PyDict_CheckConsistency(PyObject *mp, int check_content);
Expand Down