SIGN IN SIGN UP

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.
V
Victor Stinner committed
fc6bc1e4e30c8995cc4f68e56e70686d84495048
Parent: 233fd00
Committed by GitHub <noreply@github.com> on 1/24/2025, 1:29:36 PM