From a9e94674299479588b742cefa3ebe36bb72cc83b Mon Sep 17 00:00:00 2001 From: Daan Date: Mon, 31 Mar 2025 11:00:05 -0700 Subject: [PATCH 1/3] make dynamic override test verbose --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 879aa668..66b24d89 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -731,14 +731,14 @@ if (MI_BUILD_TESTS) target_include_directories(mimalloc-test-stress-dynamic PRIVATE include) if(WIN32) target_link_libraries(mimalloc-test-stress-dynamic PRIVATE mimalloc ${mi_libraries}) # mi_version - add_test(NAME test-stress-dynamic COMMAND ${CMAKE_COMMAND} -E env MIMALLOC_SHOW_STATS=1 $) + add_test(NAME test-stress-dynamic COMMAND ${CMAKE_COMMAND} -E env MIMALLOC_VERBOSE=1 $) else() if(APPLE) set(LD_PRELOAD "DYLD_INSERT_LIBRARIES") else() set(LD_PRELOAD "LD_PRELOAD") endif() - add_test(NAME test-stress-dynamic COMMAND ${CMAKE_COMMAND} -E env MIMALLOC_SHOW_STATS=1 ${LD_PRELOAD}=$ $) + add_test(NAME test-stress-dynamic COMMAND ${CMAKE_COMMAND} -E env MIMALLOC_VERBOSE=1 ${LD_PRELOAD}=$ $) endif() endif() endif() From e1110cdb9f64ec319f91fb5b5607bffd3ed76559 Mon Sep 17 00:00:00 2001 From: Daan Date: Mon, 31 Mar 2025 11:02:10 -0700 Subject: [PATCH 2/3] nicer cmake logic for windows override test --- CMakeLists.txt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 66b24d89..591ba130 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -724,13 +724,11 @@ if (MI_BUILD_TESTS) if(MI_BUILD_SHARED AND NOT (MI_TRACK_ASAN OR MI_DEBUG_TSAN OR MI_DEBUG_UBSAN)) add_executable(mimalloc-test-stress-dynamic test/test-stress.c) target_compile_definitions(mimalloc-test-stress-dynamic PRIVATE ${mi_defines} "USE_STD_MALLOC=1") - if(WIN32) - target_compile_definitions(mimalloc-test-stress-dynamic PRIVATE "MI_LINK_VERSION=1") - endif() target_compile_options(mimalloc-test-stress-dynamic PRIVATE ${mi_cflags}) target_include_directories(mimalloc-test-stress-dynamic PRIVATE include) if(WIN32) - target_link_libraries(mimalloc-test-stress-dynamic PRIVATE mimalloc ${mi_libraries}) # mi_version + target_compile_definitions(mimalloc-test-stress-dynamic PRIVATE "MI_LINK_VERSION=1") # link mi_version + target_link_libraries(mimalloc-test-stress-dynamic PRIVATE mimalloc ${mi_libraries}) # link mi_version add_test(NAME test-stress-dynamic COMMAND ${CMAKE_COMMAND} -E env MIMALLOC_VERBOSE=1 $) else() if(APPLE) From 77b622511ad86ff7ba01154dfca86dafe9032b86 Mon Sep 17 00:00:00 2001 From: Daan Date: Mon, 31 Mar 2025 14:44:46 -0700 Subject: [PATCH 3/3] fix alpine compilation with prctl.h (issue #1059) --- src/prim/unix/prim.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/prim/unix/prim.c b/src/prim/unix/prim.c index 32004fe4..09aa91b5 100644 --- a/src/prim/unix/prim.c +++ b/src/prim/unix/prim.c @@ -31,10 +31,7 @@ terms of the MIT license. A copy of the license can be found in the file #if defined(__linux__) #include - #include // PR_SET_VMA - //#if defined(MI_NO_THP) - #include // THP disable - //#endif + #include // THP disable, PR_SET_VMA #if defined(__GLIBC__) #include // linux mmap flags #else @@ -208,7 +205,7 @@ static int unix_madvise(void* addr, size_t size, int advice) { static void* unix_mmap_prim(void* addr, size_t size, int protect_flags, int flags, int fd) { void* p = mmap(addr, size, protect_flags, flags, fd, 0 /* offset */); - #if (defined(__linux__) && defined(PR_SET_VMA)) + #if defined(__linux__) && defined(PR_SET_VMA) if (p!=MAP_FAILED && p!=NULL) { prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, p, size, "mimalloc"); }