mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
[3.13] gh-125703: Correctly honour tracemalloc hooks on specialized DECREF paths (GH-125704) (#125705)
gh-125703: Correctly honour tracemalloc hooks on specialized DECREF paths (GH-125704)
(cherry picked from commit f8ba9fb2ce
)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
This commit is contained in:
parent
26f1e88aae
commit
d9ac6b3ef7
2 changed files with 7 additions and 0 deletions
|
@ -216,6 +216,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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue