aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/tracemalloc.c
Commit message (Collapse)AuthorAge
* gh-131296: fix clang-cl warning in tracemalloc.c (#131514)Victor Stinner2025-03-22
| | | | | Always set MAX_NFRAME to UINT16_MAX. Avoid the complicated code which emitted a compiler warning.
* gh-111178: Fix function signatures for multiple tests (#131496)Victor Stinner2025-03-20
|
* gh-130931: Add pycore_interpframe.h internal header (#131249)Victor Stinner2025-03-19
| | | | Move _PyInterpreterFrame and associated functions to a new pycore_interpframe.h header.
* gh-130790: Remove references about unicode's readiness from comments (#130801)Sergey Miryanov2025-03-03
|
* gh-129185: Simplify PyTraceMalloc_Track() (#129256)Victor Stinner2025-01-24
| | | | | | | | | | 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.
* gh-129185: Use PyMutex in tracemalloc (#129246)Victor Stinner2025-01-24
|
* gh-129185: Remove internal TRACE_RAW_MALLOC macro (#129218)Victor Stinner2025-01-23
| | | Always build tracemalloc with PyMem_RawMalloc() hooks.
* gh-129185: Fix PyTraceMalloc_Untrack() at Python exit (#129191)Victor Stinner2025-01-23
| | | | | | | | | 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().
* gh-128679: Use _PyThreadState_GET() in tracemalloc.c (#129126)Victor Stinner2025-01-21
| | | | Replace uncommon PyGILState_GetThisThreadState() with common _PyThreadState_GET().
* gh-128360: Add `_Py_AssertHoldsTstate` as assertion for holding a thread ↵Peter Bierma2025-01-20
| | | | | state (#128361) Co-authored-by: Kumar Aditya <kumaraditya@python.org>
* gh-128679: Fix tracemalloc.stop() race conditions (#128893)Victor Stinner2025-01-16
| | | | | | | tracemalloc_alloc(), tracemalloc_realloc(), tracemalloc_free(), _PyTraceMalloc_TraceRef() and _PyTraceMalloc_GetMemory() now check 'tracemalloc_config.tracing' after calling TABLES_LOCK(). _PyTraceMalloc_TraceRef() now always returns 0.
* gh-128679: Redesign tracemalloc locking (#128888)Victor Stinner2025-01-15
| | | | | | | | | * Use TABLES_LOCK() to protect 'tracemalloc_config.tracing'. * Hold TABLES_LOCK() longer while accessing tables. * tracemalloc_realloc() and tracemalloc_free() no longer remove the trace on reentrant call. * _PyTraceMalloc_Stop() unregisters _PyTraceMalloc_TraceRef(). * _PyTraceMalloc_GetTraces() sets the reentrant flag. * tracemalloc_clear_traces_unlocked() sets the reentrant flag.
* gh-123923: Defer refcounting for `f_executable` in `_PyInterpreterFrame` ↵Sam Gross2024-09-12
| | | | | | | | (#123924) Use a `_PyStackRef` and defer the reference to `f_executable` when possible. This avoids some reference count contention in the common case of executing the same code object from multiple threads concurrently in the free-threaded build.
* gh-121390: tracemalloc: Fix tracebacks memory leak (#121391)Josh Brobst2024-07-05
| | | | | | 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.
* gh-111389: Add PyHASH_MULTIPLIER constant (#119214)Victor Stinner2024-05-21
|
* gh-93502: Add new C-API functions to trace object creation and destruction ↵Pablo Galindo Salgado2024-05-02
| | | | (#115945)
* gh-108765: Cleanup #include in Python/*.c files (#108977)Victor Stinner2023-09-06
| | | Mention one symbol imported by each #include.
* Ignore _Py_write_noraise() result: cast to (void) (#108291)Victor Stinner2023-08-22
| | | | 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-14
| | | | | | | | | | 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-17
Modules. (#104508)