]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-129185: Fix PyTraceMalloc_Untrack() at Python exit (#129191) (#129217)
authorVictor Stinner <vstinner@python.org>
Thu, 23 Jan 2025 12:59:19 +0000 (13:59 +0100)
committerGitHub <noreply@github.com>
Thu, 23 Jan 2025 12:59:19 +0000 (13:59 +0100)
commite3b3e01d6a6f43c15890d14f139f38155601643a
treea67070ba33b265975318237ea37dff8d9c094530
parentd674792ba773d78d4ed71698b7d47fafb8842d89
[3.13] gh-129185: Fix PyTraceMalloc_Untrack() at Python exit (#129191) (#129217)

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().

(cherry picked from commit 46c7e13c055c218e18b0424efc60965e6a5fe6ea)
Lib/test/test_tracemalloc.py
Modules/_testcapi/mem.c
Modules/_testcapimodule.c
Python/pylifecycle.c
Python/tracemalloc.c