mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-12 22:24:58 +03:00
fix windows dynamic malloc overried when both ucrtbase and msvcrt are loaded; also fix virtualalloc2 on 32-bit
This commit is contained in:
parent
158705815e
commit
9390642879
3 changed files with 9 additions and 7 deletions
2
src/os.c
2
src/os.c
|
@ -62,7 +62,7 @@ static size_t mi_os_good_alloc_size(size_t size, size_t alignment) {
|
|||
#if defined(_WIN32)
|
||||
// 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.
|
||||
typedef PVOID (*VirtualAlloc2Ptr)(HANDLE, PVOID, SIZE_T, ULONG, ULONG, MEM_EXTENDED_PARAMETER*, ULONG );
|
||||
typedef PVOID (__stdcall *VirtualAlloc2Ptr)(HANDLE, PVOID, SIZE_T, ULONG, ULONG, MEM_EXTENDED_PARAMETER*, ULONG );
|
||||
static VirtualAlloc2Ptr pVirtualAlloc2 = NULL;
|
||||
|
||||
void _mi_os_init(void) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue