Skip to content

Commit dccfb90

Browse files
dschoGit for Windows Build Agent
authored and
Git for Windows Build Agent
committed
Import the source code of mimalloc v2.2.3
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: Johannes Schindelin <[email protected]>
1 parent 61277d1 commit dccfb90

31 files changed

+16394
-0
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2198,6 +2198,7 @@ $(MIMALLOC_OBJS): COMPAT_CFLAGS += -DBANNED_H
21982198
$(MIMALLOC_OBJS): COMPAT_CFLAGS += \
21992199
-Wno-attributes \
22002200
-Wno-unknown-pragmas \
2201+
-Wno-unused-function \
22012202
-Wno-array-bounds
22022203

22032204
ifdef DEVELOPER

compat/mimalloc/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2018-2025 Microsoft Corporation, Daan Leijen
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

compat/mimalloc/alloc-aligned.c

Lines changed: 360 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)