From: Pablo Galindo Salgado Date: Mon, 21 Oct 2024 14:39:05 +0000 (+0100) Subject: gh-125703: Correctly honour tracemalloc hooks on more PyDECREF specialized paths... X-Git-Tag: v3.14.0a2~349 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3d1df3d84e5c75a52b6f1379cd7f2809fc50befa;p=thirdparty%2FPython%2Fcpython.git gh-125703: Correctly honour tracemalloc hooks on more PyDECREF specialized paths (#125712) --- diff --git a/Python/ceval.c b/Python/ceval.c index 55e5eba25eaa..ca75646b585f 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -99,6 +99,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); \ } \