]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-129185: Simplify PyTraceMalloc_Track() (#129256)
authorVictor Stinner <vstinner@python.org>
Fri, 24 Jan 2025 13:29:36 +0000 (14:29 +0100)
committerGitHub <noreply@github.com>
Fri, 24 Jan 2025 13:29:36 +0000 (14:29 +0100)
commitfc6bc1e4e30c8995cc4f68e56e70686d84495048
tree2dafbcbcdd55b8aa16d177895461343ffecb888a
parent233fd00f0a19d33932e35f2fb6794ecae745b780
gh-129185: Simplify PyTraceMalloc_Track() (#129256)

Since tracemalloc uses PyMutex, it becomes safe to use TABLES_LOCK()
even after _PyTraceMalloc_Fini(): remove the "pre-check" in
PyTraceMalloc_Track() and PyTraceMalloc_Untrack().

PyTraceMalloc_Untrack() no longer needs to acquire the GIL.

_PyTraceMalloc_Fini() can be called earlier during Python
finalization.
Python/pylifecycle.c
Python/tracemalloc.c