Skip to content

Commit c373c86

Browse files
committed
[3.13] pythongh-125703: Correctly honour tracemalloc hooks on more PyDECREF specialized paths (pythonGH-125712)
(cherry picked from commit 3d1df3d) Co-authored-by: Pablo Galindo Salgado <[email protected]>
1 parent 65e43ca commit c373c86

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Python/ceval.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,11 @@
9595
} \
9696
_Py_DECREF_STAT_INC(); \
9797
if (--op->ob_refcnt == 0) { \
98+
struct _reftracer_runtime_state *tracer = &_PyRuntime.ref_tracer; \
99+
if (tracer->tracer_func != NULL) { \
100+
void* data = tracer->tracer_data; \
101+
tracer->tracer_func(op, PyRefTracer_DESTROY, data); \
102+
} \
98103
destructor d = (destructor)(dealloc); \
99104
d(op); \
100105
} \

0 commit comments

Comments
 (0)