Skip to content

[pull] main from python:main#839

Merged
pull[bot] merged 13 commits intotj-python:mainfrom
python:main
Mar 9, 2026
Merged

[pull] main from python:main#839
pull[bot] merged 13 commits intotj-python:mainfrom
python:main

Conversation

@pull
Copy link

@pull pull bot commented Mar 9, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )


📚 Documentation preview 📚: https://cpython-previews--839.org.readthedocs.build/

eendebakpt and others added 13 commits March 9, 2026 13:50
)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Return the same object unmodified if it's exactly the frozendict
type.

Optimize also PyFrozenDict_New(frozendict).
…xample (#141620)

---------

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Fix three issues that caused mimalloc pages to be leaked until the
owning thread exited:

1. In _PyMem_mi_page_maybe_free(), move pages out of the full queue
   when relying on QSBR to defer freeing the page. Pages in the full
   queue are never searched by mi_page_queue_find_free_ex(), so a page
   left there is unusable for allocations.

2. Move _PyMem_mi_page_clear_qsbr() from _mi_page_free_collect() to
   _mi_page_thread_free_collect() where it only fires when all blocks
   on the page are free (used == 0). The previous placement was too
   broad: it cleared QSBR state whenever local_free was non-NULL, but
   _mi_page_free_collect() is called from non-allocation paths (e.g.,
   page visiting in mi_heap_visit_blocks) where the page is not being
   reused.

3. In _PyMem_mi_page_maybe_free(), use the page's heap tld to find the
   correct thread state for QSBR list insertion instead of
   PyThreadState_GET(). During stop-the-world pauses, the function may
   process pages belonging to other threads, so the current thread
   state is not necessarily the owner of the page.
@pull pull bot locked and limited conversation to collaborators Mar 9, 2026
@pull pull bot added the ⤵️ pull label Mar 9, 2026
@pull pull bot merged commit d76df75 into tj-python:main Mar 9, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants