Skip to content

Commit 8ff03b6

Browse files
authored
Merge pull request #1217 from microsoft/dev-main
release v3.2.8
2 parents b69f9cb + 0c1d747 commit 8ff03b6

129 files changed

Lines changed: 7932 additions & 3392 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CMakeLists.txt

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,11 @@ set(CMAKE_C_STANDARD 11)
55
set(CMAKE_CXX_STANDARD 17)
66

77
option(MI_SECURE "Use full security mitigations (like guard pages, allocation randomization, double-free mitigation, and free-list corruption detection)" OFF)
8-
option(MI_DEBUG_FULL "Use full internal heap invariant checking in DEBUG mode (expensive)" OFF)
98
option(MI_PADDING "Enable padding to detect heap block overflow (always on in DEBUG or SECURE mode, or with Valgrind/ASAN)" OFF)
109
option(MI_OVERRIDE "Override the standard malloc interface (i.e. define entry points for 'malloc', 'free', etc)" ON)
1110
option(MI_XMALLOC "Enable abort() call on memory allocation failure by default" OFF)
1211
option(MI_SHOW_ERRORS "Show error and warning messages by default (only enabled by default in DEBUG mode)" OFF)
13-
option(MI_TRACK_VALGRIND "Compile with Valgrind support (adds a small overhead)" OFF)
14-
option(MI_TRACK_ASAN "Compile with address sanitizer support (adds a small overhead)" OFF)
15-
option(MI_TRACK_ETW "Compile with Windows event tracing (ETW) support (adds a small overhead)" OFF)
12+
option(MI_GUARDED "Build with guard pages behind certain object allocations (implies MI_NO_PADDING=ON)" OFF)
1613
option(MI_USE_CXX "Use the C++ compiler to compile the library (instead of the C compiler)" OFF)
1714
option(MI_OPT_ARCH "Only for optimized builds: turn on architecture specific optimizations (for arm64: '-march=armv8.1-a' (2016))" OFF)
1815
option(MI_SEE_ASM "Generate assembly files" OFF)
@@ -21,14 +18,23 @@ option(MI_OSX_ZONE "Use malloc zone to override standard malloc on macO
2118
option(MI_WIN_REDIRECT "Use redirection module ('mimalloc-redirect') on Windows if compiling mimalloc as a DLL" ON)
2219
option(MI_WIN_USE_FIXED_TLS "Use a fixed TLS slot on Windows to avoid extra tests in the malloc fast path" OFF)
2320
option(MI_LOCAL_DYNAMIC_TLS "Use local-dynamic-tls, a slightly slower but dlopen-compatible thread local storage mechanism (Unix)" OFF)
24-
option(MI_LIBC_MUSL "Set this when linking with musl libc" OFF)
21+
option(MI_LIBC_MUSL "Enable this when linking with musl libc" OFF)
22+
23+
option(MI_DEBUG "Enable assertion checks (enabled by default in a debug build)" OFF)
24+
option(MI_DEBUG_INTERNAL "Enable assertion and internal invariant checks (enabled by default in a debug build)" OFF)
25+
option(MI_DEBUG_FULL "Enable assertion checks and expensive internal heap invariant checking" OFF)
26+
27+
option(MI_DEBUG_TSAN "Build with thread sanitizer (needs clang)" OFF)
28+
option(MI_DEBUG_UBSAN "Build with undefined-behavior sanitizer (needs clang++)" OFF)
29+
option(MI_TRACK_VALGRIND "Compile with Valgrind support (adds a small overhead)" OFF)
30+
option(MI_TRACK_ASAN "Compile with address sanitizer support (adds a small overhead)" OFF)
31+
option(MI_TRACK_ETW "Compile with Windows event tracing (ETW) support (adds a small overhead)" OFF)
32+
2533
option(MI_BUILD_SHARED "Build shared library" ON)
2634
option(MI_BUILD_STATIC "Build static library" ON)
2735
option(MI_BUILD_OBJECT "Build object library" ON)
2836
option(MI_BUILD_TESTS "Build test executables" ON)
29-
option(MI_DEBUG_TSAN "Build with thread sanitizer (needs clang)" OFF)
30-
option(MI_DEBUG_UBSAN "Build with undefined-behavior sanitizer (needs clang++)" OFF)
31-
option(MI_GUARDED "Build with guard pages behind certain object allocations (implies MI_NO_PADDING=ON)" OFF)
37+
3238
option(MI_SKIP_COLLECT_ON_EXIT "Skip collecting memory on program exit" OFF)
3339
option(MI_NO_PADDING "Force no use of padding even in DEBUG mode etc." OFF)
3440
option(MI_INSTALL_TOPLEVEL "Install directly into $CMAKE_INSTALL_PREFIX instead of PREFIX/lib/mimalloc-version" OFF)
@@ -97,7 +103,7 @@ endif()
97103

98104
message(STATUS "")
99105
if (NOT CMAKE_BUILD_TYPE)
100-
if ("${CMAKE_BINARY_DIR}" MATCHES ".*((D|d)ebug|asan|tsan|ubsan|valgrind)$" OR MI_DEBUG_FULL)
106+
if ("${CMAKE_BINARY_DIR}" MATCHES ".*((D|d)ebug|asan|tsan|ubsan|valgrind)$")
101107
message(STATUS "No build type selected, default to 'Debug'")
102108
set(CMAKE_BUILD_TYPE "Debug")
103109
else()
@@ -296,8 +302,18 @@ if (MI_SKIP_COLLECT_ON_EXIT)
296302
endif()
297303

298304
if(MI_DEBUG_FULL)
299-
message(STATUS "Set debug level to full internal invariant checking (MI_DEBUG_FULL=ON)")
300-
list(APPEND mi_defines MI_DEBUG=3) # full invariant checking
305+
message(STATUS "Set debug level to full assertion and internal invariant checking (MI_DEBUG_FULL=ON, expensive)")
306+
list(APPEND mi_defines MI_DEBUG=3) # full invariant checking (mi_assert, mi_assert_internal, and mi_assert_expensive)
307+
elseif(MI_DEBUG_INTERNAL)
308+
message(STATUS "Set debug level to internal assertion and invariant checking (MI_DEBUG_INTERNAL=ON)")
309+
list(APPEND mi_defines MI_DEBUG=2) # invariant checking (mi_assert and mi_assert_internal)
310+
elseif(MI_DEBUG)
311+
message(STATUS "Set debug level to assertion checking (MI_DEBUG=ON)")
312+
list(APPEND mi_defines MI_DEBUG=1) # assertion checking (mi_assert)
313+
elseif(CMAKE_BUILD_TYPE MATCHES "Debug")
314+
message(STATUS "Set debug level to internal assertion and invariant checking (CMAKE_BUILD_TYPE=Debug)")
315+
set(MI_DEBUG_INTERNAL ON)
316+
list(APPEND mi_defines MI_DEBUG=2) # invariant checking (mi_assert and mi_assert_internal)
301317
endif()
302318

303319
if(MI_NO_PADDING)

contrib/vcpkg/portfile.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ vcpkg_from_github(
88
# REF e2db21e9ba9fb9172b7b0aa0fe9b8742525e8774
99

1010
# The sha512 is the hash of the tar.gz bundle.
11-
# (To get the sha512, run `vcpkg install "mimalloc[override]" --overlay-ports=./contrib/vcpkg` and copy the sha from the error message.)
12-
SHA512 176fbfd6ef3698841f8a53fb968a1198e08eef071f3d5a811046521c9bac5c3e36d024c8b1fb67e95f9018658083efd98222502e81d57e114ebb76af13008fec
11+
# (To get the sha512, run `vcpkg install "mimalloc[override]" --overlay-ports=<dir of this file>` and copy the sha from the error message.)
12+
SHA512 5830ceb1bf0d02f50fe586caaad87624ba8eba1bb66e68e8201894221cf6f51854f5a9667fc98358c3b430dae6f9bf529bfcb74d42debe6f40a487265053371c
1313
)
1414

1515
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS

contrib/vcpkg/vcpkg.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mimalloc",
3-
"version": "3.2.7",
3+
"version": "3.2.8",
44
"port-version": 0,
55
"description": "Compact general purpose allocator with excellent performance",
66
"homepage": "https://github.com/microsoft/mimalloc",

0 commit comments

Comments
 (0)