1 /* -----------------------------------------------------------------------------
3 * (c) The University of Glasgow 2006
5 * OS-specific memory management
7 * ---------------------------------------------------------------------------*/
11 lnat getPageSize (void)
13 static lnat pagesize = 0;
18 GetSystemInfo(&sSysInfo);
19 pagesize = sSysInfo.dwPageSize;
24 void setExecutable (void *p, lnat len, rtsBool exec)
26 DWORD dwOldProtect = 0;
27 if (VirtualProtect (addr, len,
28 exec ? PAGE_EXECUTE_READWRITE : PAGE_READWRITE,
31 barf("makeExecutable: failed to protect 0x%p; error=%lu; old protection: %lu\n",
32 addr, (unsigned long)GetLastError(), (unsigned long)dwOldProtect);