]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.12] gh-129185: Fix PyTraceMalloc_Untrack() at Python exit (#129191) (#129217)...
authorVictor Stinner <vstinner@python.org>
Thu, 23 Jan 2025 13:29:46 +0000 (14:29 +0100)
committerGitHub <noreply@github.com>
Thu, 23 Jan 2025 13:29:46 +0000 (13:29 +0000)
commitbb7c54d5ba6492b01b1c8731207a36196f85ea8b
treeb606643a26adc7ca0860dc33d436d13a0b02bf8a
parent880ad1813e8d61c219b7a9449d03786416509f8e
[3.12] gh-129185: Fix PyTraceMalloc_Untrack() at Python exit (#129191) (#129217) (#129221)

[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)
(cherry picked from commit e3b3e01d6a6f43c15890d14f139f38155601643a)
Lib/test/test_tracemalloc.py
Modules/_testcapi/mem.c
Modules/_testcapimodule.c
Python/pylifecycle.c
Python/tracemalloc.c