GH-124284: Add stats for refcount operations on immortal objects (GH-124288)

This commit is contained in:
Mark Shannon 2024-09-23 19:10:55 +01:00 committed by GitHub
parent 6203ef35dd
commit c87b0e4a46
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 45 additions and 10 deletions

View file

@ -79,6 +79,7 @@
do { \
PyObject *op = _PyObject_CAST(arg); \
if (_Py_IsImmortal(op)) { \
_Py_DECREF_IMMORTAL_STAT_INC(); \
break; \
} \
_Py_DECREF_STAT_INC(); \
@ -93,6 +94,7 @@
do { \
PyObject *op = _PyObject_CAST(arg); \
if (_Py_IsImmortal(op)) { \
_Py_DECREF_IMMORTAL_STAT_INC(); \
break; \
} \
_Py_DECREF_STAT_INC(); \
@ -110,6 +112,7 @@
PyObject *op = _PyObject_CAST(arg); \
uint32_t local = _Py_atomic_load_uint32_relaxed(&op->ob_ref_local); \
if (local == _Py_IMMORTAL_REFCNT_LOCAL) { \
_Py_DECREF_IMMORTAL_STAT_INC(); \
break; \
} \
_Py_DECREF_STAT_INC(); \