From d04d379f66080c9a1e0618e2d834b455b7c98bd1 Mon Sep 17 00:00:00 2001 From: daan Date: Fri, 23 Aug 2019 21:44:07 -0700 Subject: [PATCH] fix merge conflicts --- src/os.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/os.c b/src/os.c index 403f9766..a1b6cdf3 100644 --- a/src/os.c +++ b/src/os.c @@ -196,18 +196,6 @@ static bool mi_os_mem_free(void* addr, size_t size, mi_stats_t* stats) #ifdef _WIN32 static void* mi_win_virtual_allocx(void* addr, size_t size, size_t try_alignment, DWORD flags) { -#if (MI_INTPTR_SIZE >= 8) - // on 64-bit systems, use the virtual address area after 4TiB for 4MiB aligned allocations - static volatile intptr_t aligned_base = ((intptr_t)4 << 40); // starting at 4TiB - if (addr == NULL && try_alignment > 0 && - try_alignment <= MI_SEGMENT_SIZE && (size%MI_SEGMENT_SIZE) == 0) - { - intptr_t hint = mi_atomic_add(&aligned_base, size) - size; - if (hint%try_alignment == 0) { - return VirtualAlloc((void*)hint, size, flags, PAGE_READWRITE); - } - } -#endif #if defined(MEM_EXTENDED_PARAMETER_TYPE_BITS) // on modern Windows try use NtAllocateVirtualMemoryEx for 1GiB huge pages if ((size % (uintptr_t)1 << 30) == 0 /* 1GiB multiple */ @@ -236,7 +224,9 @@ static void* mi_win_virtual_allocx(void* addr, size_t size, size_t try_alignment #if (MI_INTPTR_SIZE >= 8) // on 64-bit systems, use the virtual address area after 4TiB for 4MiB aligned allocations static volatile intptr_t aligned_base = ((intptr_t)4 << 40); // starting at 4TiB - if (addr == NULL && try_alignment > 0 && try_alignment <= MI_SEGMENT_SIZE && (size%MI_SEGMENT_SIZE) == 0) { + if (addr == NULL && try_alignment > 0 && + try_alignment <= MI_SEGMENT_SIZE && (size%MI_SEGMENT_SIZE) == 0) + { intptr_t hint = mi_atomic_add(&aligned_base, size) - size; if (hint%try_alignment == 0) { return VirtualAlloc((void*)hint, size, flags, PAGE_READWRITE);