diff --git a/src/windows.cpp b/src/windows.cpp index 92a8e6ea5d..9d2cb6b58c 100644 --- a/src/windows.cpp +++ b/src/windows.cpp @@ -511,7 +511,8 @@ class MySystem: public System { virtual void* tryAllocateExecutable(unsigned sizeInBytes) { assert(this, sizeInBytes % LikelyPageSizeInBytes == 0); - return VirtualAlloc(0, sizeInBytes, MEM_RESERVE, PAGE_EXECUTE_READWRITE); + return VirtualAlloc + (0, sizeInBytes, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE); } virtual void freeExecutable(const void* p, unsigned) {