commit and reserve pages when calling VirtualAlloc on Windows

This commit is contained in:
Joel Dice 2008-04-13 12:25:24 -06:00
parent 0d3e6b7793
commit bd8d1c05d0

View File

@ -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) {