From 9c607f143b3b19d5f3cb293c349edd4a73cfae57 Mon Sep 17 00:00:00 2001 From: Anders Pistol Date: Wed, 6 Mar 2024 22:02:58 +0100 Subject: [PATCH] Traktor: Using mimalloc in Linux builds. --- code/Core/Memory/Alloc.cpp | 4 +- resources/build/ExternLinux.xms | 119 +++++++++++++++++++++++++++++++ resources/build/TraktorLinux.xms | 9 ++- scripts/config.sh | 1 + 4 files changed, 130 insertions(+), 3 deletions(-) diff --git a/code/Core/Memory/Alloc.cpp b/code/Core/Memory/Alloc.cpp index 2536ea4399..6f27bb7597 100644 --- a/code/Core/Memory/Alloc.cpp +++ b/code/Core/Memory/Alloc.cpp @@ -7,7 +7,7 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#if defined(_WIN32) +#if defined(_WIN32) || defined(__LINUX__) # define T_USE_MIMALLOC #endif @@ -63,7 +63,7 @@ void* Alloc::acquire(size_t size, const char* tag) void Alloc::free(void* ptr) { #if defined(T_USE_MIMALLOC) - mi_free(ptr); + mi_free(ptr); #else if (ptr) { diff --git a/resources/build/ExternLinux.xms b/resources/build/ExternLinux.xms index bfd4ecfbcb..f177e0aa68 100644 --- a/resources/build/ExternLinux.xms +++ b/resources/build/ExternLinux.xms @@ -5475,5 +5475,124 @@ + + true + Extern.mimalloc + $(MIMALLOC_SDK)/src + + + DebugShared + TfStaticLibrary + TpDebug + + + $(MIMALLOC_SDK)/include + + + + + WlCompilerDefault + + + + + + + + + + + ReleaseShared + TfStaticLibrary + TpRelease + + + $(MIMALLOC_SDK)/include + + + + + WlCompilerDefault + + + + + + + + + + + DebugStatic + TfStaticLibrary + TpDebug + + + $(MIMALLOC_SDK)/include + + + + + WlCompilerDefault + + + + + + + + + + + ReleaseStatic + TfStaticLibrary + TpRelease + + + $(MIMALLOC_SDK)/include + + + + + WlCompilerDefault + + + + + + + + + + + + + *.* + alloc-override.c;page-queue.c;static.c + + + + prim + + + prim/*.c + + + + + unix + + + prim/unix/*.c + + + + + + + + + + diff --git a/resources/build/TraktorLinux.xms b/resources/build/TraktorLinux.xms index 34cba52345..79dae229bd 100644 --- a/resources/build/TraktorLinux.xms +++ b/resources/build/TraktorLinux.xms @@ -646,7 +646,14 @@ - + + + true + LnkYes + ExternLinux.xms + Extern.mimalloc + + diff --git a/scripts/config.sh b/scripts/config.sh index 7d4c902137..d2ed7a7b59 100755 --- a/scripts/config.sh +++ b/scripts/config.sh @@ -43,6 +43,7 @@ export XATLAS_SDK=$TRAKTOR_HOME/3rdp/xatlas export ZLIB_SDK=$TRAKTOR_HOME/3rdp/zlib export BC6H_ENC_SDK=$TRAKTOR_HOME/3rdp/bc6h_enc export MINIMP3_SDK=$TRAKTOR_HOME/3rdp/minimp3 +export MIMALLOC_SDK=$TRAKTOR_HOME/3rdp/mimalloc # Vulkan SDK # - cleanup Extern and add Extern.vulkan which contain all paths,