summaryrefslogtreecommitdiffstats
path: root/Python/tracemalloc.c
Commit message (Collapse)AuthorAgeFilesLines
* [3.13] gh-128679: Clear the ref tracer in _PyTraceMalloc_Stop() (#129258)Victor Stinner2025-01-241-0/+2
| | | _PyTraceMalloc_Stop() now calls PyRefTracer_SetTracer(NULL, NULL).
* [3.13] gh-129185: Fix PyTraceMalloc_Untrack() at Python exit (#129191) (#129217)Victor Stinner2025-01-231-5/+26
| | | | | | | | | | | | | 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)
* [3.13] gh-128679: Fix tracemalloc.stop() race conditions (#128897)Victor Stinner2025-01-181-109/+132
| | | | | | | | | | | | | 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.
* [3.13] gh-121390: tracemalloc: Fix tracebacks memory leak (GH-121391) (#121392)Miss Islington (bot)2024-07-211-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>
* [3.13] gh-111389: Add PyHASH_MULTIPLIER constant (GH-119214) (#119334)Miss Islington (bot)2024-06-041-1/+1
| | | | | | gh-111389: Add PyHASH_MULTIPLIER constant (GH-119214) (cherry picked from commit f6da790122fdae1a28f444edfbb55202d6829cd1) Co-authored-by: Victor Stinner <vstinner@python.org>
* gh-93502: Add new C-API functions to trace object creation and destruction ↵Pablo Galindo Salgado2024-05-021-1/+9
| | | | (#115945)
* gh-108765: Cleanup #include in Python/*.c files (#108977)Victor Stinner2023-09-061-2/+3
| | | Mention one symbol imported by each #include.
* Ignore _Py_write_noraise() result: cast to (void) (#108291)Victor Stinner2023-08-221-1/+1
| | | | Code using _Py_write_noraise() usually cannot report. Ignore errors is the least surprising behavior for users.
* GH-100987: Allow objects other than code objects as the "executable" of an ↵Mark Shannon2023-06-141-1/+2
| | | | | | | | | | internal frame. (GH-105727) * Add table describing possible executable classes for out-of-process debuggers. * Remove shim code object creation code as it is no longer needed. * Make lltrace a bit more robust w.r.t. non-standard frames.
* GH-101520: Move tracemalloc functionality into core, leaving interface in ↵Mark Shannon2023-05-171-0/+1560
Modules. (#104508)