Skip to content

Commit

Permalink
pythongh-125703: Correctly honour tracemalloc hooks on specialized DE…
Browse files Browse the repository at this point in the history
…CREF paths (pythonGH-125704)

(cherry picked from commit f8ba9fb)

Co-authored-by: Pablo Galindo Salgado <[email protected]>
  • Loading branch information
pablogsal authored and miss-islington committed Oct 18, 2024
1 parent 8b275e7 commit c818188
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Include/internal/pycore_object.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ _Py_DECREF_SPECIALIZED(PyObject *op, const destructor destruct)
#ifdef Py_TRACE_REFS
_Py_ForgetReference(op);
#endif
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);
}
destruct(op);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Correctly honour :mod:`tracemalloc` hooks in specialized ``Py_DECREF``
paths. Patch by Pablo Galindo

0 comments on commit c818188

Please sign in to comment.