mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-06 07:29:30 +03:00
Merge branch 'dev' into dev-exp
This commit is contained in:
commit
113a3cc1a2
3 changed files with 44 additions and 44 deletions
|
@ -82,7 +82,7 @@ endif()
|
||||||
if(MI_USE_CXX MATCHES "ON")
|
if(MI_USE_CXX MATCHES "ON")
|
||||||
message(STATUS "Use the C++ compiler to compile (MI_USE_CXX=ON)")
|
message(STATUS "Use the C++ compiler to compile (MI_USE_CXX=ON)")
|
||||||
set_source_files_properties(${mi_sources} PROPERTIES LANGUAGE CXX )
|
set_source_files_properties(${mi_sources} PROPERTIES LANGUAGE CXX )
|
||||||
set_source_files_properties(src/static.c test/test-api.c test/test-stress.c PROPERTIES LANGUAGE CXX )
|
set_source_files_properties(src/static.c test/test-api.c PROPERTIES LANGUAGE CXX )
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Compiler flags
|
# Compiler flags
|
||||||
|
|
4
src/os.c
4
src/os.c
|
@ -81,8 +81,8 @@ static size_t mi_os_good_alloc_size(size_t size, size_t alignment) {
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
// We use VirtualAlloc2 for aligned allocation, but it is only supported on Windows 10 and Windows Server 2016.
|
// We use VirtualAlloc2 for aligned allocation, but it is only supported on Windows 10 and Windows Server 2016.
|
||||||
// So, we need to look it up dynamically to run on older systems. (use __stdcall for 32-bit compatibility)
|
// So, we need to look it up dynamically to run on older systems. (use __stdcall for 32-bit compatibility)
|
||||||
// Same for DiscardVirtualMemory
|
// Same for DiscardVirtualMemory. (hide MEM_EXTENDED_PARAMETER to compile with older SDK's)
|
||||||
typedef PVOID(__stdcall *PVirtualAlloc2)(HANDLE, PVOID, SIZE_T, ULONG, ULONG, MEM_EXTENDED_PARAMETER*, ULONG);
|
typedef PVOID(__stdcall *PVirtualAlloc2)(HANDLE, PVOID, SIZE_T, ULONG, ULONG, /* MEM_EXTENDED_PARAMETER* */ void*, ULONG);
|
||||||
typedef DWORD(__stdcall *PDiscardVirtualMemory)(PVOID,SIZE_T);
|
typedef DWORD(__stdcall *PDiscardVirtualMemory)(PVOID,SIZE_T);
|
||||||
static PVirtualAlloc2 pVirtualAlloc2 = NULL;
|
static PVirtualAlloc2 pVirtualAlloc2 = NULL;
|
||||||
static PDiscardVirtualMemory pDiscardVirtualMemory = NULL;
|
static PDiscardVirtualMemory pDiscardVirtualMemory = NULL;
|
||||||
|
|
Loading…
Add table
Reference in a new issue