mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
[3.13] gh-126076: Account for relocated objects in tracemalloc (GH-126077) (#127823)
(cherry picked from commit 30aeb00d36
)
This commit is contained in:
parent
78dfc28ff3
commit
eb692d945e
7 changed files with 18 additions and 25 deletions
|
@ -2467,11 +2467,7 @@ new_reference(PyObject *op)
|
|||
#ifdef Py_TRACE_REFS
|
||||
_Py_AddToAllObjects(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_CREATE, data);
|
||||
}
|
||||
_PyReftracerTrack(op, PyRefTracer_CREATE);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -2543,10 +2539,6 @@ _Py_ResurrectReference(PyObject *op)
|
|||
#ifdef Py_TRACE_REFS
|
||||
_Py_AddToAllObjects(op);
|
||||
#endif
|
||||
if (_PyRuntime.ref_tracer.tracer_func != NULL) {
|
||||
void* data = _PyRuntime.ref_tracer.tracer_data;
|
||||
_PyRuntime.ref_tracer.tracer_func(op, PyRefTracer_CREATE, data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -2936,15 +2928,10 @@ _Py_Dealloc(PyObject *op)
|
|||
Py_INCREF(type);
|
||||
#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);
|
||||
}
|
||||
|
||||
#ifdef Py_TRACE_REFS
|
||||
_Py_ForgetReference(op);
|
||||
#endif
|
||||
_PyReftracerTrack(op, PyRefTracer_DESTROY);
|
||||
(*dealloc)(op);
|
||||
|
||||
#ifdef Py_DEBUG
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue