8000 [3.13] gh-125703: Correctly honour tracemalloc hooks on more PyDECREF… · python/cpython@00b13ec · GitHub
[go: up one dir, main page]

Skip to content

Commit 00b13ec

Browse files
authored
[3.13] gh-125703: Correctly honour tracemalloc hooks on more PyDECREF specialized paths (GH-125712) (#125791)
(cherry picked from commit 3d1df3d)
1 parent 97c2e6a commit 00b13ec

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)
0