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