summaryrefslogtreecommitdiffstats
path: root/Python/tracemalloc.c
Commit message (Collapse)AuthorAgeFilesLines
* [3.12] gh-129185: Fix PyTraceMalloc_Untrack() at Python exit (#129191) ↵Victor Stinner2025-01-231-5/+26
| | | | | | | | | | | | | | | | | | (#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)
* [3.12] gh-128679: Fix tracemalloc.stop() race conditions (#128897) (#129022)Victor Stinner2025-01-191-109/+132
| | | | | | | | | | | | | | | | | [3.13] gh-128679: Fix tracemalloc.stop() race conditions (#128897) tracemalloc_alloc(), tracemalloc_realloc(), PyTraceMalloc_Track(), PyTraceMalloc_Untrack() and _PyTraceMalloc_TraceRef() now check tracemalloc_config.tracing after calling TABLES_LOCK(). _PyTraceMalloc_Stop() now protects more code with TABLES_LOCK(), especially setting tracemalloc_config.tracing to 1. Add a test using PyTraceMalloc_Track() to test tracemalloc.stop() race condition. Call _PyTraceMalloc_Init() at Python startup. (cherry picked from commit 6b47499510e47c0401d1f6cca2660fc12c496e39)
* [3.12] gh-121390: tracemalloc: Fix tracebacks memory leak (GH-121391) (#121393)Miss Islington (bot)2024-07-051-1/+1
| | | | | | | | | | | gh-121390: tracemalloc: Fix tracebacks memory leak (GH-121391) The tracemalloc_tracebacks hash table has traceback keys and NULL values, but its destructors do not reflect this -- key_destroy_func is NULL while value_destroy_func is raw_free. Swap these to free the traceback keys instead. (cherry picked from commit db39bc42f90c151b298f97b780e62703adbf1221) Co-authored-by: Josh Brobst <jbrobst@proton.me>
* GH-101520: Move tracemalloc functionality into core, leaving interface in ↵Mark Shannon2023-05-171-0/+1560
Modules. (#104508)