forked from git/git
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Ugrade mimalloc to 2.2.6 #6034
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Ugrade mimalloc to 2.2.6 #6034
Conversation
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
In preparation for upgrading to a newer mimalloc version. Signed-off-by: Matthias Aßhauer <mha1993@live.de>
In preparation for upgrading to a newer mimalloc version. Signed-off-by: Matthias Aßhauer <mha1993@live.de>
Update to newer mimalloc versions like this:
update_mimalloc ()
{
test $# = 1 || {
echo "Need a mimalloc version" 1>&2;
return 1
};
for oneline in 'mimalloc: adjust for building inside Git' 'Import the source code of mimalloc';
do
git revert -n HEAD^{/^"$oneline"} && git checkout HEAD -- Makefile && git commit -sm "Temporarily revert \"$oneline\"" -m 'In preparation for upgrading to a newer mimalloc version.' || return 1;
done;
for file in $(git show --format='%n' --name-only --diff-filter=A HEAD^{/^"Import the source code of mimalloc "}) compat/mimalloc/arena-abandon.c compat/mimalloc/free.c compat/mimalloc/libc.c compat/mimalloc/prim/prim.c compat/mimalloc/mimalloc-stats.h;
do
file2=${file#compat/mimalloc/};
case "$file2" in
segment-cache.c)
: no longer needed;
continue
;;
bitmap.h | *.c)
file2=src/$file2
;;
*.h)
file2=include/$file2
;;
esac;
mkdir -p "${file%/*}" && git -C /usr/src/mimalloc/ show "$1":$file2 > "$file" && git add "$file" || {
echo "Failed: $file2 -> $file" 1>&2;
return 1
};
done;
conv_sed='sed -n "/^ *eval/d;/ /p"' && git commit -sm "Import the source code of mimalloc $1" -m "Update to newer mimalloc versions like this:" -m "$(set | sed -n '/^update_mimalloc *() *$/,/^}/{s/^./ &/;p}')" -m ' update_mimalloc $MIMALLOC_VERSION' -m 'For convenience, you can set `MIMALLOC_VERSION` and then run:' -m ' eval "$(git show -s <this-commit> | '"$conv_sed"')"' || return 1;
git cherry-pick HEAD^{/^'mimalloc: adjust for building inside Git'} || return 1
}
update_mimalloc $MIMALLOC_VERSION
For convenience, you can set `MIMALLOC_VERSION` and then run:
eval "$(git show -s <this-commit> | sed -n "/^ *eval/d;/ /p")"
Signed-off-by: Matthias Aßhauer <mha1993@live.de>
We want to compile mimalloc's source code as part of Git, rather than requiring the code to be built as an external library: mimalloc uses a CMake-based build, which is not necessarily easy to integrate into the flavors of Git for Windows (which will be the main benefitting port). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Matthias Aßhauer <mha1993@live.de>
Stable Mimalloc releases will start with 3.2.x, so we don't need to monitor 3.0 and 3.1. Signed-off-by: Matthias Aßhauer <mha1993@live.de>
dscho
approved these changes
Jan 15, 2026
Member
dscho
left a comment
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.
Thank you!
Member
|
/add relnote feature Upgrades the memory allocator |
github-actions bot
pushed a commit
to git-for-windows/build-extra
that referenced
this pull request
Jan 15, 2026
[Upgrades](git-for-windows/git#6034) the [memory allocator `mimalloc`](https://microsoft.github.io/mimalloc/) that is used by Git for Windows to v2.2.6. Signed-off-by: gitforwindowshelper[bot] <gitforwindowshelper-bot@users.noreply.github.com>
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.
This fixes #6029