Skip to content

Commit

Permalink
cmake: use mimalloc instead of nedmalloc
Browse files Browse the repository at this point in the history
Just like in the regular GCC (MINGW) build, let's do the same in the
CMake (Visual C) build.

This is a long-overdue companion patch to
git-for-windows#4013

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed Aug 30, 2023
1 parent 2f819d1 commit 86661bb
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions contrib/buildsystems/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,11 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
add_compile_definitions(_CRT_SECURE_NO_WARNINGS _CRT_NONSTDC_NO_DEPRECATE)
endif()
include_directories(${CMAKE_SOURCE_DIR}/compat/win32)
include_directories(${CMAKE_SOURCE_DIR}/compat/mimalloc)
add_compile_definitions(HAVE_ALLOCA_H NO_POSIX_GOODIES NATIVE_CRLF NO_UNIX_SOCKETS WIN32
_CONSOLE DETECT_MSYS_TTY STRIP_EXTENSION=".exe" NO_SYMLINK_HEAD UNRELIABLE_FSTAT
NOGDI OBJECT_CREATION_MODE=1 __USE_MINGW_ANSI_STDIO=0
USE_NED_ALLOCATOR OVERRIDE_STRDUP MMAP_PREVENTS_DELETE USE_WIN32_MMAP
USE_MIMALLOC OVERRIDE_STRDUP MMAP_PREVENTS_DELETE USE_WIN32_MMAP
HAVE_WPGMPTR ENSURE_MSYSTEM_IS_SET HAVE_RTLGENRANDOM)
list(APPEND compat_SOURCES
compat/mingw.c
Expand All @@ -307,7 +308,19 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
compat/win32/trace2_win32_process_info.c
compat/win32/dirent.c
compat/win32/wsl.c
compat/nedmalloc/nedmalloc.c
compat/mimalloc/alloc-aligned.c
compat/mimalloc/alloc.c
compat/mimalloc/arena.c
compat/mimalloc/bitmap.c
compat/mimalloc/heap.c
compat/mimalloc/init.c
compat/mimalloc/options.c
compat/mimalloc/os.c
compat/mimalloc/page.c
compat/mimalloc/random.c
compat/mimalloc/segment.c
compat/mimalloc/segment-cache.c
compat/mimalloc/stats.c
compat/strdup.c
compat/win32/fscache.c)
set(NO_UNIX_SOCKETS 1)
Expand Down

0 comments on commit 86661bb

Please sign in to comment.