summaryrefslogtreecommitdiff
path: root/Include/internal/pycore_object.h
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2022-05-16 14:35:11 +0100
committerGitHub <noreply@github.com>2022-05-16 14:35:11 +0100
commitfa2b8b75eb2b8a0193d587e02b488a73579118fc (patch)
tree023f4ceed47906c30c68348c032a38707ec5516f /Include/internal/pycore_object.h
parentf6fd8aac13714ce17650eb4a648d5c08f0be53b4 (diff)
downloadcpython-git-fa2b8b75eb2b8a0193d587e02b488a73579118fc.tar.gz
Improve object stats (#92845)
* Add incref/decref stats * Show ratios for allocation in summary
Diffstat (limited to 'Include/internal/pycore_object.h')
-rw-r--r--Include/internal/pycore_object.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/Include/internal/pycore_object.h b/Include/internal/pycore_object.h
index f022f82469..cc50418e2e 100644
--- a/Include/internal/pycore_object.h
+++ b/Include/internal/pycore_object.h
@@ -34,6 +34,7 @@ PyAPI_FUNC(void) _Py_NO_RETURN _Py_FatalRefcountErrorFunc(
static inline void
_Py_DECREF_SPECIALIZED(PyObject *op, const destructor destruct)
{
+ _Py_DECREF_STAT_INC();
#ifdef Py_REF_DEBUG
_Py_RefTotal--;
#endif
@@ -51,6 +52,7 @@ _Py_DECREF_SPECIALIZED(PyObject *op, const destructor destruct)
static inline void
_Py_DECREF_NO_DEALLOC(PyObject *op)
{
+ _Py_DECREF_STAT_INC();
#ifdef Py_REF_DEBUG
_Py_RefTotal--;
#endif