Skip to content

Commit 3d1df3d

Browse files
authored
gh-125703: Correctly honour tracemalloc hooks on more PyDECREF specialized paths (#125712)
1 parent 5989eb7 commit 3d1df3d

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
@@ -99,6 +99,11 @@
9999
} \
100100
_Py_DECREF_STAT_INC(); \
101101
if (--op->ob_refcnt == 0) { \
102+
struct _reftracer_runtime_state *tracer = &_PyRuntime.ref_tracer; \
103+
if (tracer->tracer_func != NULL) { \
104+
void* data = tracer->tracer_data; \
105+
tracer->tracer_func(op, PyRefTracer_DESTROY, data); \
106+
} \
102107
destructor d = (destructor)(dealloc); \
103108
d(op); \
104109
} \

0 commit comments

Comments
 (0)