set MAP_32BIT for 32bit machines

This commit is contained in:
Dain 2008-01-14 09:33:54 -07:00
parent 0298865efa
commit faa3052b28

View File

@ -503,6 +503,10 @@ class MySystem: public System {
virtual void* tryAllocate(unsigned size, bool executable) {
assert(this, (not executable) or (size % LikelyPageSizeInBytes == 0));
#ifndef MAP_32BIT
#define MAP_32BIT 0
#endif
if (executable) {
void* p = mmap(0, size, PROT_EXEC | PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS | MAP_32BIT, -1, 0);