GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [3.14] gh-159111: Update vendored mimalloc to v2.5.2 (gh-159112) by corona10 · Pull Request #160183 · python/cpython

Conversation

@corona10

@corona10 corona10 commented Oct 22, 2026 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member
  • Issue: Upgrade mimalloc version from 2.1.2 to 2.5.2 #159111

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@corona10
[3.14] pythongh-159111: Update vendored mimalloc to v2.5.2 (pythongh-…
e58e6d0
…159112)

* Update vendored mimalloc to v2.5.2

Upgrade mimalloc from v2.1.2 to v2.5.2 as-is from upstream.

v2.1.2: https://github.com/microsoft/mimalloc/releases/tag/v2.1.2
v2.5.2: https://github.com/microsoft/mimalloc/releases/tag/v2.5.2

* Re-apply CPython-specific changes to mimalloc v2.5.2

Most of the previous downstream changes were upstreamed in mimalloc
v2.1.3 - v2.1.7 (heap tags, _mi_heap_init/_mi_tld_init, MI_PRIM_THREAD_ID,
sub-processes, heap walk optimizations, platform fixes) and are dropped.

Remaining CPython-specific changes, all marked with a "CPython" comment:

- QSBR delayed page freeing for free-threaded builds (pythongh-115103,
  pythongh-145615): mi_page_t/mi_heap_t fields and _PyMem_mi_* hooks in
  page.c, heap.c and segment.c.
- debug_offset: preserve the first bytes of a PyObject (ob_tid, refcount
  fields) when filling freed or uninitialized memory in debug builds
  (pythongh-115491).
- Atomic mi_block_t.next loads/stores to avoid TSAN reports (pythongh-129748).
- Relax the owning thread assertion in _mi_free_delayed_block for
  free-threaded builds, since the GC traverses heaps of other threads.
- Call _mi_heap_delayed_free_partial() in mi_heap_visit_blocks()
  (pythongh-112532).
- Only count reclaimed pages up to MI_MEDIUM_OBJ_SIZE_MAX as a
  "right page" in mi_segment_reclaim (pythongh-115103).
- Rename the weak _ZSt15get_new_handlerv symbol and disable the
  mi_is_in_heap_region debug warning.
- Zero-initialize _mi_page_empty instead of a positional initializer.

* Update the free-threaded build to mimalloc v2.5.2 changes

mimalloc v2.1.4 replaced the list of abandoned segments with per-arena
bitmaps and introduced sub-processes (mi_subproc_t) to keep abandoned
segments of separate interpreters apart. Use them instead of the
CPython-specific mi_abandoned_pool_t:

- Each interpreter owns a mi_subproc_t created in init_interpreter().
- tstate_mimalloc_bind() sets tld->segments.subproc and uses the
  upstream _mi_heap_init() signature.
- The GC and sys.getallocatedblocks() visit abandoned segments with
  _PyMem_mi_visit_abandoned_blocks(), the upstream cursor API without
  the mi_option_visit_abandoned requirement, while STW.

* Update NEWS.d

* fix MSAN

* fix TSAN

* fix test_cext

* Disable THP

* Address code review

* Address code review

* Address code review

* nit

* Address code review

* Address code review
(cherry picked from commit aff7a2e)

Co-authored-by: Donghee Na <[email protected]>
@corona10
corona10 requested review from a team, ericsnowcurrently, erlend-aasland and rhettinger as code owners October 22, 2026 04:26
@bedevere-app bedevere-app Bot mentioned this pull request Oct 22, 2026
gh-159111: Update vendored mimalloc to v2.5.2 #159112
Merged
@bedevere-app bedevere-app Bot added sprint type-feature A feature request or enhancement labels Oct 22, 2026
@github-project-automation github-project-automation Bot added this to Sprint Oct 22, 2026
@github-project-automation github-project-automation Bot moved this to Todo in Sprint Oct 22, 2026
@bedevere-app bedevere-app Bot mentioned this pull request Oct 22, 2026
Upgrade mimalloc version from 2.1.2 to 2.5.2 #159111
Closed
@bedevere-app bedevere-app Bot added the awaiting core review label Oct 22, 2026
@read-the-docs-community

read-the-docs-community Bot commented Oct 22, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #35316473 | 📁 Comparing 7bcb211 against main (d4750a7)

  🔍 Preview build  

320 files changed · + 1 added · ± 298 modified · - 21 deleted

+ Added

  • library/asyncio-policy.html

± Modified

  • about.html
  • bugs.html
  • glossary.html
  • index.html
  • license.html
  • py-modindex.html
  • builtins/exceptions.html
  • builtins/functions.html
  • builtins/stdtypes.html
  • builtins/time-complexity.html
  • and 288 more...

- Deleted

  • _static/tachyon-example-flamegraph.html
  • _static/tachyon-example-heatmap.html
  • c-api/sentinel.html
  • c-api/slots.html
  • deprecations/c-api-pending-removal-in-3.19.html
  • deprecations/c-api-pending-removal-in-3.20.html
  • deprecations/pending-removal-in-3.20.html
  • deprecations/pending-removal-in-3.21.html
  • deprecations/soft-deprecations.html
  • extending/first-extension-module.html
  • and 11 more...
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

corona10 added 2 commits October 21, 2026 22:33
@corona10
Use __wasm__ in marshal.c now that mimalloc no longer defines __wasi_…
51b0656
…_ on Emscripten (from pythonGH-159039)
@corona10
pythongh-159111: Mark remaining CPython-specific changes in vendored …
7bcb211
…mimalloc with a comment
@corona10
corona10 requested a review from DinoV October 22, 2026 06:27
@corona10

corona10 commented Oct 22, 2026

Copy link
Copy Markdown
Member Author

@DinoV Need the approval before merge :)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

DinoV
DinoV approved these changes Oct 22, 2026
View reviewed changes

@DinoV DinoV left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woot!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels Oct 22, 2026
@corona10
corona10 merged commit 1bcc0d1 into python:3.14 Oct 22, 2026
52 of 53 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@github-project-automation github-project-automation Bot moved this from In Progress to Done in Sprint Oct 22, 2026
@bedevere-app bedevere-app Bot removed the awaiting merge label Oct 22, 2026
@hugovk

hugovk commented Oct 23, 2026

Copy link
Copy Markdown
Member

test_embed.InitConfigTests.test_init_in_background_thread is now failing on "x86-64 MacOS Intel ASAN NoGIL 3.14" after this:

  • https://buildbot.python.org/#/builders/1729/builds/1801
  • https://buildbot.python.org/#/builders/1729
  • https://buildbot.python.org/release-status

main and 3.15 are green.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hugovk hugovk mentioned this pull request Oct 24, 2026
gh-160588: Restore the gh-123022 check in the vendored mimalloc #160589
Merged
@XuehaiPan XuehaiPan mentioned this pull request Nov 10, 2026
Free-threaded GC can abort during concurrent subinterpreter teardown #161751
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@DinoV DinoV DinoV approved these changes
@rhettinger rhettinger Awaiting requested review from rhettinger rhettinger is a code owner
@ericsnowcurrently ericsnowcurrently Awaiting requested review from ericsnowcurrently ericsnowcurrently is a code owner
@erlend-aasland erlend-aasland Awaiting requested review from erlend-aasland erlend-aasland is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

sprint type-feature A feature request or enhancement

Projects

Sprint
Archived in project

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@corona10 @hugovk @DinoV
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.