Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump mimalloc to 3.0.1
Browse files Browse the repository at this point in the history
TerrorJack committed Jan 6, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 963359a commit 12725e0
Showing 2 changed files with 6 additions and 15 deletions.
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

set -eu

MIMALLOC_VERSION=2.1.7
MIMALLOC_VERSION=3.0.1

cd /tmp

19 changes: 5 additions & 14 deletions mimalloc.diff
Original file line number Diff line number Diff line change
@@ -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<size_t>(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)

0 comments on commit 12725e0

Please sign in to comment.