From 7bb5e29a984c2d509b072eafddc78ec712426c5a Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Wed, 16 Jul 2014 02:20:29 -0700 Subject: [PATCH] Now that mapping is done through a different code path, we can properly allocate large memory chunks on Windows --- src/platform/windows/memory.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/platform/windows/memory.c b/src/platform/windows/memory.c index dfc43311e..e7acc9f89 100644 --- a/src/platform/windows/memory.c +++ b/src/platform/windows/memory.c @@ -1,13 +1,13 @@ #include "util/memory.h" -#include #include void* anonymousMemoryMap(size_t size) { - HANDLE hMap = CreateFileMapping(INVALID_HANDLE_VALUE, 0, PAGE_READWRITE, 0, size & 0xFFFFFFFF, 0); - return MapViewOfFile(hMap, FILE_MAP_WRITE, 0, 0, size); + return VirtualAlloc(NULL, size, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE); } void mappedMemoryFree(void* memory, size_t size) { - // TODO fill in + UNUSED(size); + // size is not useful here because we're freeing the memory, not decommitting it + VirtualFree(memory, 0, MEM_RELEASE); }