Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
gh-125703: Correctly honour tracemalloc hooks on specialized DECREF p…
…aths (GH-125704)

(cherry picked from commit f8ba9fb)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
  • Loading branch information
pablogsal authored and miss-islington committed Oct 18, 2024
commit c818188bb867215e925a4d5987407bb791b2e8af
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