]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-129185: Fix PyTraceMalloc_Untrack() at Python exit (#129191)
authorVictor Stinner <vstinner@python.org>
Thu, 23 Jan 2025 11:07:34 +0000 (12:07 +0100)
committerGitHub <noreply@github.com>
Thu, 23 Jan 2025 11:07:34 +0000 (12:07 +0100)
commit46c7e13c055c218e18b0424efc60965e6a5fe6ea
tree1233606a473a8c9b5c6d0bf2b6d80b10c784e12c
parent225296cd5b505c180d3f45c355b43d7e1d99d3d5
gh-129185: Fix PyTraceMalloc_Untrack() at Python exit (#129191)

Support calling PyTraceMalloc_Track() and PyTraceMalloc_Untrack()
during late Python finalization.

* Call _PyTraceMalloc_Fini() later in Python finalization.
* Test also PyTraceMalloc_Untrack() without the GIL
* PyTraceMalloc_Untrack() now gets the GIL.
* Test also PyTraceMalloc_Untrack() in test_tracemalloc_track_race().
Lib/test/test_tracemalloc.py
Modules/_testcapi/mem.c
Modules/_testcapimodule.c
Python/pylifecycle.c
Python/tracemalloc.c