FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

use mimalloc as raw memory allocator in free-threading · Issue #144914 · python/cpython · GitHub

Repository navigation

use mimalloc as raw memory allocator in free-threading #144914

Closed

Description

This came up in context of numpy/numpy#30494.

Currently the raw allocator (PyMem_RawMalloc and friends) uses the system allocator because it should be possible to call these APIs without an active thread state. pymalloc requires an active thread state hence that cannot be used, however on free-threading we can instead use mimalloc instead of directly calling the system allocator.

Using mimalloc instead of system allocator I see much less contention while freeing the memory on macos, see the benchmark on the numpy issue on how to reproduce the issue.

Linked PRs

Activity

  1. added a commit that references this issue on Feb 18, 2026
  2. added a commit that references this issue on Feb 28, 2026
  3. added a commit that references this issue on Apr 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.15bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usagetopic-free-threadingtype-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL