[3.13] gh-125703: Correctly honour tracemalloc hooks on more PyDECREF specialized paths (GH-125712) (#125791)

(cherry picked from commit 3d1df3d84e)
This commit is contained in:
Pablo Galindo Salgado 2024-10-28 11:50:36 +00:00 committed by GitHub
parent 97c2e6ac27
commit 00b13ec050
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -95,6 +95,11 @@
} \
_Py_DECREF_STAT_INC(); \
if (--op->ob_refcnt == 0) { \
struct _reftracer_runtime_state *tracer = &_PyRuntime.ref_tracer; \
if (tracer->tracer_func != NULL) { \
void* data = tracer->tracer_data; \
tracer->tracer_func(op, PyRefTracer_DESTROY, data); \
} \
destructor d = (destructor)(dealloc); \
d(op); \
} \