mirror of https://github.com/python/cpython
[3.13] gh-111499: Fix PYTHONMALLOCSTATS at Python exit (GH-120021) (#120022)
gh-111499: Fix PYTHONMALLOCSTATS at Python exit (GH-120021)
Call _PyObject_DebugMallocStats() earlier in Py_FinalizeEx(), before
the interpreter is deleted.
(cherry picked from commit 5a1205b641
)
Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
parent
1177897551
commit
6e67fd5bea
|
@ -2119,6 +2119,12 @@ Py_FinalizeEx(void)
|
||||||
}
|
}
|
||||||
#endif /* Py_TRACE_REFS */
|
#endif /* Py_TRACE_REFS */
|
||||||
|
|
||||||
|
#ifdef WITH_PYMALLOC
|
||||||
|
if (malloc_stats) {
|
||||||
|
_PyObject_DebugMallocStats(stderr);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
finalize_interp_delete(tstate->interp);
|
finalize_interp_delete(tstate->interp);
|
||||||
|
|
||||||
#ifdef Py_REF_DEBUG
|
#ifdef Py_REF_DEBUG
|
||||||
|
@ -2129,12 +2135,6 @@ Py_FinalizeEx(void)
|
||||||
#endif
|
#endif
|
||||||
_Py_FinalizeAllocatedBlocks(runtime);
|
_Py_FinalizeAllocatedBlocks(runtime);
|
||||||
|
|
||||||
#ifdef WITH_PYMALLOC
|
|
||||||
if (malloc_stats) {
|
|
||||||
_PyObject_DebugMallocStats(stderr);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
call_ll_exitfuncs(runtime);
|
call_ll_exitfuncs(runtime);
|
||||||
|
|
||||||
_PyRuntime_Finalize();
|
_PyRuntime_Finalize();
|
||||||
|
|
Loading…
Reference in New Issue