@shd101wyy/yo 0.1.24 → 0.1.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/skills/yo-core-patterns/core-patterns-cheatsheet.md +30 -0
- package/.github/skills/yo-syntax/syntax-cheatsheet.md +436 -2
- package/out/cjs/index.cjs +551 -553
- package/out/cjs/yo-cli.cjs +638 -632
- package/out/cjs/yo-lsp.cjs +595 -597
- package/out/esm/index.mjs +487 -489
- package/out/types/src/codegen/utils/index.d.ts +1 -0
- package/out/types/src/expr.d.ts +1 -0
- package/out/types/src/test-runner.d.ts +1 -0
- package/out/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/vendor/mimalloc/.github/workflows/release.yaml +55 -0
- package/vendor/mimalloc/.github/workflows/stale.yaml +27 -0
- package/vendor/mimalloc/.github/workflows/test.yaml +163 -0
- package/vendor/mimalloc/CMakeLists.txt +52 -33
- package/vendor/mimalloc/azure-pipelines.yml +4 -3
- package/vendor/mimalloc/bin/bundle.bat +74 -0
- package/vendor/mimalloc/bin/bundle.sh +232 -0
- package/vendor/mimalloc/cmake/mimalloc-config-version.cmake +2 -2
- package/vendor/mimalloc/contrib/docker/alpine/Dockerfile +1 -1
- package/vendor/mimalloc/contrib/docker/alpine-arm32v7/Dockerfile +2 -2
- package/vendor/mimalloc/contrib/docker/alpine-x86/Dockerfile +1 -1
- package/vendor/mimalloc/contrib/docker/manylinux-x64/Dockerfile +1 -1
- package/vendor/mimalloc/contrib/vcpkg/portfile.cmake +4 -3
- package/vendor/mimalloc/contrib/vcpkg/vcpkg.json +1 -1
- package/vendor/mimalloc/doc/mimalloc-doc.h +42 -4
- package/vendor/mimalloc/doc/release-notes.md +15 -0
- package/vendor/mimalloc/ide/vs2022/mimalloc-lib.vcxproj +3 -3
- package/vendor/mimalloc/ide/vs2022/mimalloc-override-static-lib.vcxproj +511 -0
- package/vendor/mimalloc/ide/vs2022/mimalloc-override-static-lib.vcxproj.filters +117 -0
- package/vendor/mimalloc/ide/vs2022/mimalloc-test-dep.vcxproj +360 -0
- package/vendor/mimalloc/ide/vs2022/mimalloc-test-override-static.vcxproj +310 -0
- package/vendor/mimalloc/ide/vs2022/mimalloc.sln +92 -35
- package/vendor/mimalloc/include/mimalloc/atomic.h +178 -182
- package/vendor/mimalloc/include/mimalloc/bits.h +8 -10
- package/vendor/mimalloc/include/mimalloc/internal.h +76 -32
- package/vendor/mimalloc/include/mimalloc/prim.h +25 -18
- package/vendor/mimalloc/include/mimalloc/track.h +7 -2
- package/vendor/mimalloc/include/mimalloc/types.h +57 -29
- package/vendor/mimalloc/include/mimalloc-override.h +10 -10
- package/vendor/mimalloc/include/mimalloc-stats.h +18 -6
- package/vendor/mimalloc/include/mimalloc.h +22 -12
- package/vendor/mimalloc/readme.md +42 -17
- package/vendor/mimalloc/src/alloc-aligned.c +13 -11
- package/vendor/mimalloc/src/alloc-override.c +97 -17
- package/vendor/mimalloc/src/alloc-posix.c +44 -27
- package/vendor/mimalloc/src/alloc.c +73 -23
- package/vendor/mimalloc/src/arena-meta.c +3 -3
- package/vendor/mimalloc/src/arena.c +380 -192
- package/vendor/mimalloc/src/bitmap.c +68 -18
- package/vendor/mimalloc/src/bitmap.h +8 -4
- package/vendor/mimalloc/src/free.c +83 -47
- package/vendor/mimalloc/src/heap.c +94 -40
- package/vendor/mimalloc/src/init.c +273 -102
- package/vendor/mimalloc/src/libc.c +53 -8
- package/vendor/mimalloc/src/options.c +43 -40
- package/vendor/mimalloc/src/os.c +110 -45
- package/vendor/mimalloc/src/page-map.c +14 -8
- package/vendor/mimalloc/src/page-queue.c +9 -6
- package/vendor/mimalloc/src/page.c +26 -16
- package/vendor/mimalloc/src/prim/emscripten/prim.c +10 -1
- package/vendor/mimalloc/src/prim/osx/alloc-override-zone.c +35 -16
- package/vendor/mimalloc/src/prim/unix/prim.c +26 -22
- package/vendor/mimalloc/src/prim/wasi/prim.c +7 -4
- package/vendor/mimalloc/src/prim/windows/prim.c +247 -44
- package/vendor/mimalloc/src/random.c +8 -3
- package/vendor/mimalloc/src/stats.c +59 -48
- package/vendor/mimalloc/src/theap.c +85 -44
- package/vendor/mimalloc/src/threadlocal.c +102 -41
- package/vendor/mimalloc/test/main-override-static.c +31 -2
- package/vendor/mimalloc/test/main-override.c +27 -14
- package/vendor/mimalloc/test/main-static-dep.cpp +46 -0
- package/vendor/mimalloc/test/main-static-dep.h +11 -0
- package/vendor/mimalloc/test/test-api-fill.c +2 -2
- package/vendor/mimalloc/test/test-stress.c +3 -3
- package/vendor/mimalloc/test/test-wrong.c +11 -7
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
#!/bin/sh -e
|
|
2
|
+
|
|
3
|
+
#-----------------------------------------------------------------------------
|
|
4
|
+
# Bundle release
|
|
5
|
+
#-----------------------------------------------------------------------------
|
|
6
|
+
|
|
7
|
+
OSARCH=""
|
|
8
|
+
OSNAME=""
|
|
9
|
+
MI_TAG=""
|
|
10
|
+
MI_COMMIT=""
|
|
11
|
+
|
|
12
|
+
#---------------------------------------------------------
|
|
13
|
+
# Helper functions
|
|
14
|
+
#---------------------------------------------------------
|
|
15
|
+
|
|
16
|
+
info() {
|
|
17
|
+
if [ -z "$QUIET" ] ; then
|
|
18
|
+
echo "$@"
|
|
19
|
+
fi
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
warn() {
|
|
23
|
+
echo "$@" >&2
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
stop() {
|
|
27
|
+
warn $@
|
|
28
|
+
exit 1
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
has_cmd() {
|
|
32
|
+
command -v "$1" > /dev/null 2>&1
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
#---------------------------------------------------------
|
|
37
|
+
# Detect git tag and commit
|
|
38
|
+
#---------------------------------------------------------
|
|
39
|
+
|
|
40
|
+
detect_git_tag() {
|
|
41
|
+
if [ -z "$MI_COMMIT" ] ; then
|
|
42
|
+
MI_COMMIT=`git rev-parse HEAD`
|
|
43
|
+
fi
|
|
44
|
+
if [ -z "$MI_TAG" ] ; then
|
|
45
|
+
MI_TAG=`git describe --tag`
|
|
46
|
+
fi
|
|
47
|
+
info "Tag : $MI_TAG"
|
|
48
|
+
info "Commit : $MI_COMMIT"
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
#---------------------------------------------------------
|
|
53
|
+
# Detect OS and cpu architecture
|
|
54
|
+
#---------------------------------------------------------
|
|
55
|
+
|
|
56
|
+
detect_osarch() {
|
|
57
|
+
arch="$(uname -m)"
|
|
58
|
+
case "$arch" in
|
|
59
|
+
x86_64*|amd64*)
|
|
60
|
+
arch="x64";;
|
|
61
|
+
x86*|i[35678]86*)
|
|
62
|
+
arch="x86";;
|
|
63
|
+
arm64*|aarch64*|armv8*)
|
|
64
|
+
arch="arm64";;
|
|
65
|
+
arm*)
|
|
66
|
+
arch="arm";;
|
|
67
|
+
parisc*)
|
|
68
|
+
arch="hppa";;
|
|
69
|
+
esac
|
|
70
|
+
|
|
71
|
+
OSNAME="linux"
|
|
72
|
+
case "$(uname)" in
|
|
73
|
+
[Ll]inux)
|
|
74
|
+
OSNAME="linux";;
|
|
75
|
+
[Dd]arwin)
|
|
76
|
+
OSNAME="macos";;
|
|
77
|
+
[Ff]ree[Bb][Ss][Dd])
|
|
78
|
+
OSNAME="unix-freebsd";;
|
|
79
|
+
[Oo]pen[Bb][Ss][Dd])
|
|
80
|
+
OSNAME="unix-openbsd";;
|
|
81
|
+
*)
|
|
82
|
+
info "Warning: assuming generic Linux"
|
|
83
|
+
esac
|
|
84
|
+
OSARCH="$OSNAME-$arch"
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
#---------------------------------------------------------
|
|
88
|
+
# Command line options
|
|
89
|
+
#---------------------------------------------------------
|
|
90
|
+
|
|
91
|
+
process_options() {
|
|
92
|
+
while : ; do
|
|
93
|
+
flag="$1"
|
|
94
|
+
case "$flag" in
|
|
95
|
+
*=*) flag_arg="${flag#*=}";;
|
|
96
|
+
*) flag_arg="yes" ;;
|
|
97
|
+
esac
|
|
98
|
+
# echo "option: $flag, arg: $flag_arg"
|
|
99
|
+
case "$flag" in
|
|
100
|
+
"") break;;
|
|
101
|
+
-q|--quiet)
|
|
102
|
+
QUIET="yes";;
|
|
103
|
+
-p) shift
|
|
104
|
+
PREFIX="$1";;
|
|
105
|
+
-p=*|--prefix=*)
|
|
106
|
+
PREFIX=`eval echo $flag_arg`;; # no quotes so ~ gets expanded (issue #412)
|
|
107
|
+
-h|--help|-\?|help|\?)
|
|
108
|
+
MODE="help";;
|
|
109
|
+
*) case "$flag" in
|
|
110
|
+
*) warn "warning: unknown option \"$1\".";;
|
|
111
|
+
esac;;
|
|
112
|
+
esac
|
|
113
|
+
shift
|
|
114
|
+
done
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
#---------------------------------------------------------
|
|
118
|
+
# Download
|
|
119
|
+
#---------------------------------------------------------
|
|
120
|
+
|
|
121
|
+
download_failed() { # <program> <url>
|
|
122
|
+
stop "unable to download: $2"
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
download_file() { # <url|file> <destination file>
|
|
126
|
+
case "$1" in
|
|
127
|
+
ftp://*|http://*|https://*)
|
|
128
|
+
info "Downloading: $1"
|
|
129
|
+
if has_cmd curl ; then
|
|
130
|
+
if ! curl ${QUIET:+-sS} --proto =https --tlsv1.2 -f -L -o "$2" "$1"; then
|
|
131
|
+
download_failed "curl" $1
|
|
132
|
+
fi
|
|
133
|
+
elif has_cmd wget ; then
|
|
134
|
+
if ! wget ${QUIET:+-q} --https-only "-O$2" "$1"; then
|
|
135
|
+
download_failed "wget" $1
|
|
136
|
+
fi
|
|
137
|
+
else
|
|
138
|
+
stop "Neither 'curl' nor 'wget' is available; install one to continue."
|
|
139
|
+
fi;;
|
|
140
|
+
*)
|
|
141
|
+
info "Copying: $1"
|
|
142
|
+
if ! cp $1 $2 ; then
|
|
143
|
+
stop "Unable to copy from $1"
|
|
144
|
+
fi;;
|
|
145
|
+
esac
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
#---------------------------------------------------------
|
|
149
|
+
# Bundle
|
|
150
|
+
#---------------------------------------------------------
|
|
151
|
+
|
|
152
|
+
download_source_at_commit() { # <commit> <output file>
|
|
153
|
+
download_file "https://github.com/microsoft/mimalloc/archive/$1.tar.gz" "$2"
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
build_test_install() { # <type> <bundledir> <prefix> <cmake args>
|
|
157
|
+
info "Build, test, install: $1 to $3"
|
|
158
|
+
build_dir="$2/$1"
|
|
159
|
+
mkdir -p "$build_dir"
|
|
160
|
+
cmake . -B "$build_dir" $4
|
|
161
|
+
cmake --build "$build_dir" --parallel 4
|
|
162
|
+
ctest --test-dir "$build_dir"
|
|
163
|
+
cmake --install "$build_dir" --prefix "$3"
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
main_bundle() {
|
|
167
|
+
# config
|
|
168
|
+
bundle_dir="out/bundle"
|
|
169
|
+
mkdir -p "$bundle_dir"
|
|
170
|
+
if [ -z "$PREFIX" ] ; then
|
|
171
|
+
prefix_dir="$bundle_dir/prefix"
|
|
172
|
+
else
|
|
173
|
+
prefix_dir="$PREFIX"
|
|
174
|
+
fi
|
|
175
|
+
|
|
176
|
+
# build
|
|
177
|
+
build_test_install "debug" "$bundle_dir" "$prefix_dir" "-DCMAKE_BUILD_TYPE=Debug"
|
|
178
|
+
build_test_install "release" "$bundle_dir" "$prefix_dir" "-DCMAKE_BUILD_TYPE=Release -DMI_OPT_ARCH=ON"
|
|
179
|
+
build_test_install "secure" "$bundle_dir" "$prefix_dir" "-DCMAKE_BUILD_TYPE=Release -DMI_OPT_ARCH=ON -DMI_SECURE=ON"
|
|
180
|
+
|
|
181
|
+
# archive binaries
|
|
182
|
+
binary_archive_name="mimalloc-$MI_TAG-$OSARCH.tar.gz"
|
|
183
|
+
binary_archive="$bundle_dir/$binary_archive_name"
|
|
184
|
+
info "Create binary archive: $binary_archive_name"
|
|
185
|
+
(cd "$prefix_dir" && tar -czvf "../$binary_archive_name" .)
|
|
186
|
+
|
|
187
|
+
# source archive
|
|
188
|
+
if [ "$OSNAME" = "linux" ] ; then
|
|
189
|
+
info "Download source archive for $MI_TAG"
|
|
190
|
+
source_archive="$bundle_dir/mimalloc-$MI_TAG-source.tar.gz"
|
|
191
|
+
download_source_at_commit "$MI_COMMIT" "$source_archive"
|
|
192
|
+
fi
|
|
193
|
+
|
|
194
|
+
# done
|
|
195
|
+
info ""
|
|
196
|
+
info "Created:"
|
|
197
|
+
info " - $binary_archive"
|
|
198
|
+
if [ -n "$source_archive" ] ; then
|
|
199
|
+
info " - $source_archive"
|
|
200
|
+
fi
|
|
201
|
+
info ""
|
|
202
|
+
info "Done."
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
#---------------------------------------------------------
|
|
206
|
+
# Main
|
|
207
|
+
#---------------------------------------------------------
|
|
208
|
+
|
|
209
|
+
main_help() {
|
|
210
|
+
info "command:"
|
|
211
|
+
info " ./bin/bundle.sh [options]"
|
|
212
|
+
info ""
|
|
213
|
+
info "options:"
|
|
214
|
+
info " -q, --quiet suppress output"
|
|
215
|
+
info " -p, --prefix=<dir> prefix directory ($PREFIX)"
|
|
216
|
+
info " -h, --help show command line options"
|
|
217
|
+
info ""
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
main_start() {
|
|
221
|
+
detect_osarch
|
|
222
|
+
detect_git_tag
|
|
223
|
+
process_options $@
|
|
224
|
+
if [ "$MODE" = "help" ] ; then
|
|
225
|
+
main_help
|
|
226
|
+
else
|
|
227
|
+
main_bundle
|
|
228
|
+
fi
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
# note: only start executing commands now to guard against partial downloads
|
|
232
|
+
main_start $@
|
|
@@ -10,7 +10,7 @@ RUN mkdir -p /home/dev
|
|
|
10
10
|
WORKDIR /home/dev
|
|
11
11
|
|
|
12
12
|
# Get mimalloc
|
|
13
|
-
RUN git clone https://github.com/microsoft/mimalloc -b
|
|
13
|
+
RUN git clone https://github.com/microsoft/mimalloc -b dev3
|
|
14
14
|
RUN mkdir -p mimalloc/out/release
|
|
15
15
|
RUN mkdir -p mimalloc/out/debug
|
|
16
16
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
FROM scratch
|
|
5
5
|
|
|
6
6
|
# Substitute the image name that was downloaded
|
|
7
|
-
ADD alpine-minirootfs-
|
|
7
|
+
ADD alpine-minirootfs-20260127-armv7.tar.gz /
|
|
8
8
|
|
|
9
9
|
# Install tools
|
|
10
10
|
RUN apk add build-base make cmake
|
|
@@ -15,7 +15,7 @@ RUN mkdir -p /home/dev
|
|
|
15
15
|
WORKDIR /home/dev
|
|
16
16
|
|
|
17
17
|
# Get mimalloc
|
|
18
|
-
RUN git clone https://github.com/microsoft/mimalloc -b
|
|
18
|
+
RUN git clone https://github.com/microsoft/mimalloc -b dev3
|
|
19
19
|
RUN mkdir -p mimalloc/out/release
|
|
20
20
|
RUN mkdir -p mimalloc/out/debug
|
|
21
21
|
|
|
@@ -15,7 +15,7 @@ RUN mkdir -p /home/dev
|
|
|
15
15
|
WORKDIR /home/dev
|
|
16
16
|
|
|
17
17
|
# Get mimalloc
|
|
18
|
-
RUN git clone https://github.com/microsoft/mimalloc -b
|
|
18
|
+
RUN git clone https://github.com/microsoft/mimalloc -b dev3
|
|
19
19
|
RUN mkdir -p mimalloc/out/release
|
|
20
20
|
RUN mkdir -p mimalloc/out/debug
|
|
21
21
|
|
|
@@ -10,7 +10,7 @@ RUN mkdir -p /home/dev
|
|
|
10
10
|
WORKDIR /home/dev
|
|
11
11
|
|
|
12
12
|
# Get mimalloc
|
|
13
|
-
RUN git clone https://github.com/microsoft/mimalloc -b
|
|
13
|
+
RUN git clone https://github.com/microsoft/mimalloc -b dev3
|
|
14
14
|
RUN mkdir -p mimalloc/out/release
|
|
15
15
|
RUN mkdir -p mimalloc/out/debug
|
|
16
16
|
|
|
@@ -3,12 +3,13 @@ vcpkg_from_github(
|
|
|
3
3
|
REPO microsoft/mimalloc
|
|
4
4
|
HEAD_REF master
|
|
5
5
|
|
|
6
|
-
# The "REF" can be a commit hash, branch name (dev3), or a version (v3.2
|
|
6
|
+
# The "REF" can be a commit hash, branch name (dev3), or a version (v3.3.2).
|
|
7
7
|
REF "v${VERSION}"
|
|
8
8
|
|
|
9
9
|
# The sha512 is the hash of the tar.gz bundle.
|
|
10
|
-
# (To get the sha512, run `vcpkg install "mimalloc[override]" --overlay-ports
|
|
11
|
-
|
|
10
|
+
# (To get the sha512, run `vcpkg install "mimalloc[override]" --overlay-ports=<dir of this file>` and copy the sha from the error message.)
|
|
11
|
+
# (and maybe `vcpkg remove mimalloc` first to remove any previous install)
|
|
12
|
+
SHA512 601bdf622d0bc7521edf0cc73d1caec9d976bcd1faa689ff48cc18a9a6a3b2294b571fc71d3266b38907bc5aad10a41d92d03d2cdde139a30b08357ee7bc25c5
|
|
12
13
|
)
|
|
13
14
|
|
|
14
15
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
|
@@ -572,13 +572,18 @@ void* mi_heap_malloc(mi_heap_t* heap, size_t size);
|
|
|
572
572
|
|
|
573
573
|
/// Allocate a small object in a specific heap.
|
|
574
574
|
/// \a size must be smaller or equal to MI_SMALL_SIZE_MAX().
|
|
575
|
-
/// @see
|
|
575
|
+
/// @see mi_malloc_small()
|
|
576
576
|
void* mi_heap_malloc_small(mi_heap_t* heap, size_t size);
|
|
577
577
|
|
|
578
578
|
/// Allocate zero-initialized in a specific heap.
|
|
579
579
|
/// @see mi_zalloc()
|
|
580
580
|
void* mi_heap_zalloc(mi_heap_t* heap, size_t size);
|
|
581
581
|
|
|
582
|
+
/// Allocate a small object in a specific heap.
|
|
583
|
+
/// \a size must be smaller or equal to MI_SMALL_SIZE_MAX().
|
|
584
|
+
/// @see mi_zalloc_small()
|
|
585
|
+
void* mi_heap_zalloc_small(mi_heap_t* heap, size_t size);
|
|
586
|
+
|
|
582
587
|
/// Allocate \a count zero-initialized elements in a specific heap.
|
|
583
588
|
/// @see mi_calloc()
|
|
584
589
|
void* mi_heap_calloc(mi_heap_t* heap, size_t count, size_t size);
|
|
@@ -877,7 +882,8 @@ bool mi_subproc_visit_heaps(mi_subproc_id_t subproc, mi_heap_visit_fun* visitor,
|
|
|
877
882
|
/// \{
|
|
878
883
|
|
|
879
884
|
/// Maximum size allowed for small allocations in
|
|
880
|
-
/// #mi_malloc_small
|
|
885
|
+
/// #mi_malloc_small, #mi_zalloc_small, #mi_heap_malloc_small, #mi_heap_zalloc_small,
|
|
886
|
+
/// #mi_theap_malloc_small, and #mi_theap_zalloc_small (usually `128*sizeof(void*)` (= 1KB on 64-bit systems))
|
|
881
887
|
#define MI_SMALL_SIZE_MAX (128*sizeof(void*))
|
|
882
888
|
|
|
883
889
|
/// @brief Return the mimalloc version.
|
|
@@ -1000,9 +1006,27 @@ void* mi_malloc_small(size_t size);
|
|
|
1000
1006
|
/// with care!
|
|
1001
1007
|
void* mi_zalloc_small(size_t size);
|
|
1002
1008
|
|
|
1009
|
+
/// __v3__: Can be used to free an object that was allocated with #mi_malloc_small et al.
|
|
1010
|
+
/// @param p Pointer that was returned from #mi_malloc_small et al.
|
|
1011
|
+
/// @details
|
|
1012
|
+
/// This function is meant for use in run-time systems for best
|
|
1013
|
+
/// performance and does not check if the pointer was _indeed_ allocated
|
|
1014
|
+
/// with #mi_malloc_small (et al) -- use with care!
|
|
1015
|
+
/// This function has a small perf benefit but only if mimalloc was built with `MI_PAGE_META_ALIGNED_FREE_SMALL=1`
|
|
1016
|
+
/// @see mi_malloc_small()
|
|
1017
|
+
/// @see mi_zalloc_small()
|
|
1018
|
+
/// @see mi_heap_malloc_small()
|
|
1019
|
+
/// @see mi_heap_zalloc_small()
|
|
1020
|
+
/// @see mi_theap_malloc_small()
|
|
1021
|
+
/// @see mi_theap_zalloc_small()
|
|
1022
|
+
void mi_free_small(void* p);
|
|
1023
|
+
|
|
1003
1024
|
/// \}
|
|
1004
1025
|
|
|
1005
1026
|
|
|
1027
|
+
|
|
1028
|
+
|
|
1029
|
+
|
|
1006
1030
|
// ------------------------------------------------------
|
|
1007
1031
|
// Statistics
|
|
1008
1032
|
// ------------------------------------------------------
|
|
@@ -1302,11 +1326,25 @@ mi_theap_t* mi_theap_set_default(mi_theap_t* theap);
|
|
|
1302
1326
|
/// @returns The current default theap.
|
|
1303
1327
|
mi_theap_t* mi_theap_get_default();
|
|
1304
1328
|
|
|
1305
|
-
|
|
1329
|
+
/// Allocate in a specific theap.
|
|
1330
|
+
/// @see mi_malloc()
|
|
1306
1331
|
void* mi_theap_malloc(mi_theap_t* theap, size_t size);
|
|
1332
|
+
|
|
1333
|
+
/// Allocate a small object in a specific theap.
|
|
1334
|
+
/// \a size must be smaller or equal to MI_SMALL_SIZE_MAX().
|
|
1335
|
+
/// @see mi_malloc_small()
|
|
1336
|
+
void* mi_theap_malloc_small(mi_theap_t* theap, size_t size);
|
|
1337
|
+
|
|
1338
|
+
/// Allocate zero-initialized in a specific heap.
|
|
1339
|
+
/// @see mi_zalloc()
|
|
1307
1340
|
void* mi_theap_zalloc(mi_theap_t* theap, size_t size);
|
|
1341
|
+
|
|
1342
|
+
/// Allocate a small object in a specific theap.
|
|
1343
|
+
/// \a size must be smaller or equal to MI_SMALL_SIZE_MAX().
|
|
1344
|
+
/// @see mi_zalloc_small()
|
|
1345
|
+
void* mi_theap_zalloc_small(mi_theap_t* theap, size_t size);
|
|
1346
|
+
|
|
1308
1347
|
void* mi_theap_calloc(mi_theap_t* theap, size_t count, size_t size);
|
|
1309
|
-
void* mi_theap_malloc_small(mi_theap_t* theap, size_t size);
|
|
1310
1348
|
void* mi_theap_malloc_aligned(mi_theap_t* theap, size_t size, size_t alignment);
|
|
1311
1349
|
void* mi_theap_realloc(mi_theap_t* theap, void* p, size_t newsize);
|
|
1312
1350
|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
Binary and source releases for mimalloc.
|
|
2
|
+
|
|
3
|
+
- __v3__: recommended: latest mimalloc design that tends to use less memory then v2 but should perform similarly.
|
|
4
|
+
- __v2__: stable: most widely used.
|
|
5
|
+
- __v1__: legacy.
|
|
6
|
+
|
|
7
|
+
Notes:
|
|
8
|
+
|
|
9
|
+
- Release versions follow the v3 version (and v1 and v2 versions are incremented independently).
|
|
10
|
+
- Generally it is recommended to download sources (or use `vcpkg` etc.) and build mimalloc as
|
|
11
|
+
part of your project.
|
|
12
|
+
- Source releases can also be downloaded directly from github by the tag.
|
|
13
|
+
For example <https://github.com/microsoft/mimalloc/archive/v3.3.2.tar.gz>.
|
|
14
|
+
- Binary releases include a release-, debug-, and secure build.
|
|
15
|
+
- Linux binaries are built on Ubuntu 22.
|
|
@@ -194,7 +194,7 @@
|
|
|
194
194
|
<SDLCheck>true</SDLCheck>
|
|
195
195
|
<ConformanceMode>Default</ConformanceMode>
|
|
196
196
|
<AdditionalIncludeDirectories>../../include</AdditionalIncludeDirectories>
|
|
197
|
-
<PreprocessorDefinitions>MI_DEBUG=3
|
|
197
|
+
<PreprocessorDefinitions>MI_DEBUG=3;%(PreprocessorDefinitions);</PreprocessorDefinitions>
|
|
198
198
|
<CompileAs>CompileAsCpp</CompileAs>
|
|
199
199
|
<SupportJustMyCode>false</SupportJustMyCode>
|
|
200
200
|
<LanguageStandard>stdcpp20</LanguageStandard>
|
|
@@ -222,7 +222,7 @@
|
|
|
222
222
|
<SDLCheck>true</SDLCheck>
|
|
223
223
|
<ConformanceMode>Default</ConformanceMode>
|
|
224
224
|
<AdditionalIncludeDirectories>../../include</AdditionalIncludeDirectories>
|
|
225
|
-
<PreprocessorDefinitions>MI_DEBUG=3
|
|
225
|
+
<PreprocessorDefinitions>MI_DEBUG=3;%(PreprocessorDefinitions);</PreprocessorDefinitions>
|
|
226
226
|
<CompileAs>CompileAsCpp</CompileAs>
|
|
227
227
|
<SupportJustMyCode>false</SupportJustMyCode>
|
|
228
228
|
<LanguageStandard>stdcpp20</LanguageStandard>
|
|
@@ -307,7 +307,7 @@
|
|
|
307
307
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
|
308
308
|
<ConformanceMode>Default</ConformanceMode>
|
|
309
309
|
<AdditionalIncludeDirectories>../../include</AdditionalIncludeDirectories>
|
|
310
|
-
<PreprocessorDefinitions>%(PreprocessorDefinitions);NDEBUG</PreprocessorDefinitions>
|
|
310
|
+
<PreprocessorDefinitions>%(PreprocessorDefinitions);NDEBUG;MI_GUARDED=1</PreprocessorDefinitions>
|
|
311
311
|
<AssemblerOutput>AssemblyAndSourceCode</AssemblerOutput>
|
|
312
312
|
<AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
|
|
313
313
|
<WholeProgramOptimization>false</WholeProgramOptimization>
|