]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-125703: Correctly honour tracemalloc hooks on more PyDECREF specialized paths...
authorPablo Galindo Salgado <Pablogsal@gmail.com>
Mon, 21 Oct 2024 14:39:05 +0000 (15:39 +0100)
committerGitHub <noreply@github.com>
Mon, 21 Oct 2024 14:39:05 +0000 (15:39 +0100)
Python/ceval.c

index 55e5eba25eaa211c8f76232be66340d9399a8dde..ca75646b585f079505fbcb62578c8a64865a83ba 100644 (file)
         } \
         _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); \
         } \