mirror of
https://github.com/python/cpython.git
synced 2025-08-09 11:29:45 +00:00
gh-111499: Fix PYTHONMALLOCSTATS at Python exit (#120021)
Call _PyObject_DebugMallocStats() earlier in Py_FinalizeEx(), before
the interpreter is deleted.
(cherry picked from commit 5a1205b641
)
This commit is contained in:
parent
3bf7a5079c
commit
e3e7607167
1 changed files with 7 additions and 5 deletions
|
@ -1969,6 +1969,13 @@ Py_FinalizeEx(void)
|
||||||
// XXX Ensure finalizer errors are handled properly.
|
// XXX Ensure finalizer errors are handled properly.
|
||||||
|
|
||||||
finalize_interp_clear(tstate);
|
finalize_interp_clear(tstate);
|
||||||
|
|
||||||
|
#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
|
||||||
|
@ -1994,11 +2001,6 @@ Py_FinalizeEx(void)
|
||||||
fclose(dump_refs_fp);
|
fclose(dump_refs_fp);
|
||||||
}
|
}
|
||||||
#endif /* Py_TRACE_REFS */
|
#endif /* Py_TRACE_REFS */
|
||||||
#ifdef WITH_PYMALLOC
|
|
||||||
if (malloc_stats) {
|
|
||||||
_PyObject_DebugMallocStats(stderr);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
call_ll_exitfuncs(runtime);
|
call_ll_exitfuncs(runtime);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue