{{ message }}
ENH: use raw memory allocation APIs under free-threading - #30846
Merged
Merged
Conversation
seberg
reviewed
Feb 19, 2026
kumaraditya303
force-pushed
the
mimalloc-upstream
branch
from
February 19, 2026 15:06
587020d to
139cdf6
Compare
ngoldbaum
reviewed
Feb 19, 2026
ngoldbaum
approved these changes
Feb 19, 2026
seberg
approved these changes
Feb 23, 2026
seberg
left a comment
Member
There was a problem hiding this comment.
LGTM, since I think Nathan also doesn't think this affects things default Python builds and it is unlikely to affect more than a hand-few of projects, let's get it in.
(I'll apply a tiny change, since I think the release notes section will get mangled up otherwise.)
Member
sabasiddique1
pushed a commit
to sabasiddique1/numpy
that referenced
this pull request
Mar 4, 2026
Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Fixes #30494
This PR changes
alloc.cppto use raw memory allocation APIs from CPython so that it can usemimallocunder 3.15 free-threaded builds. I have also removed the unnecessaryNPY_BEGIN_THREADS_DEFcalls to release the thread state which just adds overhead. For reference CPython also does not releases the thread state when allocating memory so this aligns numpy with CPython.