mirror of https://github.com/python/cpython
gh-102304: Rename _Py_IncRefTotal_DO_NOT_USE_THIS() (#107193)
* Rename _Py_IncRefTotal_DO_NOT_USE_THIS() to _Py_INCREF_IncRefTotal() * Rename _Py_DecRefTotal_DO_NOT_USE_THIS() to _Py_DECREF_DecRefTotal() * Remove temporary _Py_INC_REFTOTAL() and _Py_DEC_REFTOTAL() macros
This commit is contained in:
parent
e717b47ed8
commit
8ebc9fc321
|
@ -594,10 +594,8 @@ you can count such references to the type object.)
|
||||||
#if defined(Py_REF_DEBUG) && !defined(Py_LIMITED_API)
|
#if defined(Py_REF_DEBUG) && !defined(Py_LIMITED_API)
|
||||||
PyAPI_FUNC(void) _Py_NegativeRefcount(const char *filename, int lineno,
|
PyAPI_FUNC(void) _Py_NegativeRefcount(const char *filename, int lineno,
|
||||||
PyObject *op);
|
PyObject *op);
|
||||||
PyAPI_FUNC(void) _Py_IncRefTotal_DO_NOT_USE_THIS(void);
|
PyAPI_FUNC(void) _Py_INCREF_IncRefTotal(void);
|
||||||
PyAPI_FUNC(void) _Py_DecRefTotal_DO_NOT_USE_THIS(void);
|
PyAPI_FUNC(void) _Py_DECREF_DecRefTotal(void);
|
||||||
# define _Py_INC_REFTOTAL() _Py_IncRefTotal_DO_NOT_USE_THIS()
|
|
||||||
# define _Py_DEC_REFTOTAL() _Py_DecRefTotal_DO_NOT_USE_THIS()
|
|
||||||
#endif // Py_REF_DEBUG && !Py_LIMITED_API
|
#endif // Py_REF_DEBUG && !Py_LIMITED_API
|
||||||
|
|
||||||
PyAPI_FUNC(void) _Py_Dealloc(PyObject *);
|
PyAPI_FUNC(void) _Py_Dealloc(PyObject *);
|
||||||
|
@ -646,7 +644,7 @@ static inline Py_ALWAYS_INLINE void Py_INCREF(PyObject *op)
|
||||||
#endif
|
#endif
|
||||||
_Py_INCREF_STAT_INC();
|
_Py_INCREF_STAT_INC();
|
||||||
#ifdef Py_REF_DEBUG
|
#ifdef Py_REF_DEBUG
|
||||||
_Py_INC_REFTOTAL();
|
_Py_INCREF_IncRefTotal();
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -675,7 +673,7 @@ static inline void Py_DECREF(const char *filename, int lineno, PyObject *op)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_Py_DECREF_STAT_INC();
|
_Py_DECREF_STAT_INC();
|
||||||
_Py_DEC_REFTOTAL();
|
_Py_DECREF_DecRefTotal();
|
||||||
if (--op->ob_refcnt != 0) {
|
if (--op->ob_refcnt != 0) {
|
||||||
if (op->ob_refcnt < 0) {
|
if (op->ob_refcnt < 0) {
|
||||||
_Py_NegativeRefcount(filename, lineno, op);
|
_Py_NegativeRefcount(filename, lineno, op);
|
||||||
|
@ -703,9 +701,6 @@ static inline Py_ALWAYS_INLINE void Py_DECREF(PyObject *op)
|
||||||
#define Py_DECREF(op) Py_DECREF(_PyObject_CAST(op))
|
#define Py_DECREF(op) Py_DECREF(_PyObject_CAST(op))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#undef _Py_INC_REFTOTAL
|
|
||||||
#undef _Py_DEC_REFTOTAL
|
|
||||||
|
|
||||||
|
|
||||||
/* Safely decref `op` and set `op` to NULL, especially useful in tp_clear
|
/* Safely decref `op` and set `op` to NULL, especially useful in tp_clear
|
||||||
* and tp_dealloc implementations.
|
* and tp_dealloc implementations.
|
||||||
|
|
|
@ -207,14 +207,14 @@ _Py_NegativeRefcount(const char *filename, int lineno, PyObject *op)
|
||||||
|
|
||||||
/* This is used strictly by Py_INCREF(). */
|
/* This is used strictly by Py_INCREF(). */
|
||||||
void
|
void
|
||||||
_Py_IncRefTotal_DO_NOT_USE_THIS(void)
|
_Py_INCREF_IncRefTotal(void)
|
||||||
{
|
{
|
||||||
reftotal_increment(_PyInterpreterState_GET());
|
reftotal_increment(_PyInterpreterState_GET());
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This is used strictly by Py_DECREF(). */
|
/* This is used strictly by Py_DECREF(). */
|
||||||
void
|
void
|
||||||
_Py_DecRefTotal_DO_NOT_USE_THIS(void)
|
_Py_DECREF_DecRefTotal(void)
|
||||||
{
|
{
|
||||||
reftotal_decrement(_PyInterpreterState_GET());
|
reftotal_decrement(_PyInterpreterState_GET());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue