From 1a756444a5c1484d26af9cd39187752728416ba8 Mon Sep 17 00:00:00 2001 From: Cheng Shao Date: Mon, 6 Jan 2025 10:38:20 +0000 Subject: [PATCH] Bump mimalloc to 3.0.1 --- build.sh | 2 +- mimalloc.diff | 19 +++++-------------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/build.sh b/build.sh index 763e9e7..751117b 100755 --- a/build.sh +++ b/build.sh @@ -2,7 +2,7 @@ set -eu -MIMALLOC_VERSION=2.1.7 +MIMALLOC_VERSION=3.0.1 cd /tmp diff --git a/mimalloc.diff b/mimalloc.diff index e29768a..6160826 100644 --- a/mimalloc.diff +++ b/mimalloc.diff @@ -1,20 +1,20 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 2bcd1ef..6521343 100644 +index 05b97fc9..aec7b6b4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -422,7 +422,6 @@ endif() +@@ -590,7 +590,6 @@ endif() # static library if (MI_BUILD_STATIC) add_library(mimalloc-static STATIC ${mi_sources}) - set_property(TARGET mimalloc-static PROPERTY POSITION_INDEPENDENT_CODE ON) target_compile_definitions(mimalloc-static PRIVATE ${mi_defines} MI_STATIC_LIB) - target_compile_options(mimalloc-static PRIVATE ${mi_cflags}) + target_compile_options(mimalloc-static PRIVATE ${mi_cflags} ${mi_cflags_static}) target_link_libraries(mimalloc-static PRIVATE ${mi_libraries}) diff --git a/src/alloc-override.c b/src/alloc-override.c -index 873065d..10a1709 100644 +index b5109ded..22bd061f 100644 --- a/src/alloc-override.c +++ b/src/alloc-override.c -@@ -181,7 +181,7 @@ typedef struct mi_nothrow_s { int _tag; } mi_nothrow_t; +@@ -191,7 +191,7 @@ typedef void* mi_nothrow_t; void* operator new[](std::size_t n, std::align_val_t al, const std::nothrow_t&) noexcept { return mi_new_aligned_nothrow(n, static_cast(al)); } #endif @@ -23,12 +23,3 @@ index 873065d..10a1709 100644 // ------------------------------------------------------ // Override by defining the mangled C++ names of the operators (as // used by GCC and CLang). -@@ -272,7 +272,7 @@ void* _aligned_malloc(size_t alignment, size_t size) { return mi_aligned_allo - void __libc_free(void* p) MI_FORWARD0(mi_free, p) - void* __libc_memalign(size_t alignment, size_t size) { return mi_memalign(alignment, size); } - --#elif defined(__GLIBC__) && defined(__linux__) -+#elif defined(__linux__) - // forward __libc interface (needed for glibc-based Linux distributions) - void* __libc_malloc(size_t size) MI_FORWARD1(mi_malloc,size) - void* __libc_calloc(size_t count, size_t size) MI_FORWARD2(mi_calloc,count,size)