Skip to content

Commit

Permalink
Traktor: Using mimalloc in Linux builds.
Browse files Browse the repository at this point in the history
  • Loading branch information
apistol78 committed Mar 6, 2024
1 parent 5ffc316 commit 9c607f1
Show file tree
Hide file tree
Showing 4 changed files with 130 additions and 3 deletions.
4 changes: 2 additions & 2 deletions code/Core/Memory/Alloc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
{
Expand Down
119 changes: 119 additions & 0 deletions resources/build/ExternLinux.xms
Original file line number Diff line number Diff line change
Expand Up @@ -5475,5 +5475,124 @@
</items>
<dependencies/>
</item>
<item type="Project" version="1">
<enable>true</enable>
<name>Extern.mimalloc</name>
<sourcePath>$(MIMALLOC_SDK)/src</sourcePath>
<configurations>
<item type="Configuration" version="5">
<name>DebugShared</name>
<targetFormat>TfStaticLibrary</targetFormat>
<targetProfile>TpDebug</targetProfile>
<precompiledHeader/>
<includePaths>
<item>$(MIMALLOC_SDK)/include</item>
</includePaths>
<definitions/>
<libraryPaths/>
<libraries/>
<warningLevel>WlCompilerDefault</warningLevel>
<additionalCompilerOptions/>
<additionalLinkerOptions/>
<debugExecutable/>
<debugArguments/>
<debugEnvironment/>
<debugWorkingDirectory/>
<aggregationItems/>
<consumerLibraryPath/>
</item>
<item type="Configuration" version="5">
<name>ReleaseShared</name>
<targetFormat>TfStaticLibrary</targetFormat>
<targetProfile>TpRelease</targetProfile>
<precompiledHeader/>
<includePaths>
<item>$(MIMALLOC_SDK)/include</item>
</includePaths>
<definitions/>
<libraryPaths/>
<libraries/>
<warningLevel>WlCompilerDefault</warningLevel>
<additionalCompilerOptions/>
<additionalLinkerOptions/>
<debugExecutable/>
<debugArguments/>
<debugEnvironment/>
<debugWorkingDirectory/>
<aggregationItems/>
<consumerLibraryPath/>
</item>
<item type="Configuration" version="5">
<name>DebugStatic</name>
<targetFormat>TfStaticLibrary</targetFormat>
<targetProfile>TpDebug</targetProfile>
<precompiledHeader/>
<includePaths>
<item>$(MIMALLOC_SDK)/include</item>
</includePaths>
<definitions/>
<libraryPaths/>
<libraries/>
<warningLevel>WlCompilerDefault</warningLevel>
<additionalCompilerOptions/>
<additionalLinkerOptions/>
<debugExecutable/>
<debugArguments/>
<debugEnvironment/>
<debugWorkingDirectory/>
<aggregationItems/>
<consumerLibraryPath/>
</item>
<item type="Configuration" version="5">
<name>ReleaseStatic</name>
<targetFormat>TfStaticLibrary</targetFormat>
<targetProfile>TpRelease</targetProfile>
<precompiledHeader/>
<includePaths>
<item>$(MIMALLOC_SDK)/include</item>
</includePaths>
<definitions/>
<libraryPaths/>
<libraries/>
<warningLevel>WlCompilerDefault</warningLevel>
<additionalCompilerOptions/>
<additionalLinkerOptions/>
<debugExecutable/>
<debugArguments/>
<debugEnvironment/>
<debugWorkingDirectory/>
<aggregationItems/>
<consumerLibraryPath/>
</item>
</configurations>
<items>
<item type="File" version="1">
<fileName>*.*</fileName>
<excludeFilter>alloc-override.c;page-queue.c;static.c</excludeFilter>
<items/>
</item>
<item type="Filter">
<name>prim</name>
<items>
<item type="File" version="1">
<fileName>prim/*.c</fileName>
<excludeFilter/>
<items/>
</item>
<item type="Filter">
<name>unix</name>
<items>
<item type="File" version="1">
<fileName>prim/unix/*.c</fileName>
<excludeFilter/>
<items/>
</item>
</items>
</item>
</items>
</item>
</items>
<dependencies/>
</item>
</projects>
</object>
9 changes: 8 additions & 1 deletion resources/build/TraktorLinux.xms
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,14 @@
</items>
</item>
</items>
<dependencies/>
<dependencies>
<item type="ExternalDependency" version="3">
<inheritIncludePaths>true</inheritIncludePaths>
<link>LnkYes</link>
<solutionFileName>ExternLinux.xms</solutionFileName>
<projectName>Extern.mimalloc</projectName>
</item>
</dependencies>
</project>
</item>
<item type="ProjectDependency" version="3">
Expand Down
1 change: 1 addition & 0 deletions scripts/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 9c607f1

Please sign in to comment.