]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-115184: Fix refleak tracking issues in free-threaded build (#115188)
authorSam Gross <colesbury@gmail.com>
Fri, 9 Feb 2024 14:23:12 +0000 (09:23 -0500)
committerGitHub <noreply@github.com>
Fri, 9 Feb 2024 14:23:12 +0000 (09:23 -0500)
commit31633f4473966b3bcd470440bab7f348711be48f
tree6709b485b67d502baf3300a023fa6a068baa6db5
parent769d4448260aaec687d9306950225316f9faefce
gh-115184: Fix refleak tracking issues in free-threaded build (#115188)

Fixes a few issues related to refleak tracking in the free-threaded build:

- Count blocks in abandoned segments
- Call `_mi_page_free_collect` earlier during heap traversal in order to get an accurate count of blocks in use.
- Add missing refcount tracking in `_Py_DecRefSharedDebug` and `_Py_ExplicitMergeRefcount`.
- Pause threads in  `get_num_global_allocated_blocks` to ensure that traversing the mimalloc heaps is safe.
Objects/mimalloc/heap.c
Objects/object.c
Objects/obmalloc.c