]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-125703: Correctly honour tracemalloc hooks on more PyDECREF specialized...
authorPablo Galindo Salgado <Pablogsal@gmail.com>
Mon, 28 Oct 2024 11:50:36 +0000 (11:50 +0000)
committerGitHub <noreply@github.com>
Mon, 28 Oct 2024 11:50:36 +0000 (11:50 +0000)
(cherry picked from commit 3d1df3d84e5c75a52b6f1379cd7f2809fc50befa)

Python/ceval.c

index 3c7ca9512c7a97cd59c8102456e7a8218a41df48..d970ffa0309a8d99eec50c68129d801fd3cc7c32 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); \
         } \