mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-06 15:29:31 +03:00
Merge branch 'dev3' of https://github.com/microsoft/mimalloc into dev3
This commit is contained in:
commit
1500d73e9a
2 changed files with 15 additions and 4 deletions
|
@ -431,9 +431,18 @@ if(CMAKE_C_COMPILER_ID MATCHES "AppleClang|Clang|GNU|Intel")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Compiler and architecture specific flags
|
||||||
if(CMAKE_C_COMPILER_ID MATCHES "AppleClang|Clang|GNU|Intel" AND NOT CMAKE_SYSTEM_NAME MATCHES "Haiku")
|
if(CMAKE_C_COMPILER_ID MATCHES "AppleClang|Clang|GNU|Intel" AND NOT CMAKE_SYSTEM_NAME MATCHES "Haiku")
|
||||||
if(MI_OPT_ARCH)
|
if(MI_OPT_ARCH)
|
||||||
if(MI_ARCH STREQUAL "x64")
|
if(APPLE AND CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_OSX_ARCHITECTURES) # to support multi-arch binaries (#999)
|
||||||
|
set(MI_OPT_ARCH_FLAGS "")
|
||||||
|
if("arm64" IN_LIST CMAKE_OSX_ARCHITECTURES)
|
||||||
|
list(APPEND MI_OPT_ARCH_FLAGS "-Xarch_arm64;-march=armv8.1-a;-mtune=native")
|
||||||
|
endif()
|
||||||
|
if("x86_64" IN_LIST CMAKE_OSX_ARCHITECTURES)
|
||||||
|
list(APPEND MI_OPT_ARCH_FLAGS "-Xarch_x86_64;-march=haswell;-Xarch_x86_64;-mavx2")
|
||||||
|
endif()
|
||||||
|
elseif(MI_ARCH STREQUAL "x64")
|
||||||
set(MI_OPT_ARCH_FLAGS "-march=haswell;-mavx2;-mtune=native") # fast bit scan (since 2013)
|
set(MI_OPT_ARCH_FLAGS "-march=haswell;-mavx2;-mtune=native") # fast bit scan (since 2013)
|
||||||
elseif(MI_ARCH STREQUAL "arm64")
|
elseif(MI_ARCH STREQUAL "arm64")
|
||||||
set(MI_OPT_ARCH_FLAGS "-march=armv8.1-a;-mtune=native") # fast atomics (since 2016)
|
set(MI_OPT_ARCH_FLAGS "-march=armv8.1-a;-mtune=native") # fast atomics (since 2016)
|
||||||
|
|
|
@ -127,9 +127,11 @@ void _mi_prim_mem_init( mi_os_mem_config_t* config )
|
||||||
config->has_partial_free = false;
|
config->has_partial_free = false;
|
||||||
config->has_virtual_reserve = true;
|
config->has_virtual_reserve = true;
|
||||||
// windows version
|
// windows version
|
||||||
const DWORD win_version = GetVersion();
|
OSVERSIONINFOW version{sizeof(version)};
|
||||||
win_major_version = (DWORD)(LOBYTE(LOWORD(win_version)));
|
if (GetVersionExW(&version)) {
|
||||||
win_minor_version = (DWORD)(HIBYTE(LOWORD(win_version)));
|
win_major_version = version.dwMajorVersion;
|
||||||
|
win_minor_version = version.dwMinorVersion;
|
||||||
|
}
|
||||||
// get the page size
|
// get the page size
|
||||||
SYSTEM_INFO si;
|
SYSTEM_INFO si;
|
||||||
GetSystemInfo(&si);
|
GetSystemInfo(&si);
|
||||||
|
|
Loading…
Add table
Reference in a new issue