Bug 568782 add #ifdef SOLARIS for mmap/munmap changes r=igor

This commit is contained in:
Ginn Chen 2010-07-30 18:51:58 +08:00
Родитель 832e801c21
Коммит e3e7455490
2 изменённых файлов: 13 добавлений и 0 удалений

Просмотреть файл

@ -164,7 +164,11 @@ StackSpace::finish()
#elif defined(XP_OS2)
DosFreeMem(base);
#else
#ifdef SOLARIS
munmap((caddr_t)base, CAPACITY_BYTES);
#else
munmap(base, CAPACITY_BYTES);
#endif
#endif
}

Просмотреть файл

@ -202,8 +202,13 @@ MapAlignedPages(size_t size, size_t alignment)
* We don't use MAP_FIXED here, because it can cause the *replacement*
* of existing mappings, and we only want to create new mappings.
*/
#ifdef SOLARIS
void *p = mmap((caddr_t) alignment, size, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_NOSYNC | MAP_ALIGN | MAP_ANON, -1, 0);
#else
void *p = mmap((void *) alignment, size, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_NOSYNC | MAP_ALIGN | MAP_ANON, -1, 0);
#endif
if (p == MAP_FAILED)
return NULL;
return p;
@ -235,7 +240,11 @@ MapPages(void *addr, size_t size)
static void
UnmapPages(void *addr, size_t size)
{
#ifdef SOLARIS
JS_ALWAYS_TRUE(munmap((caddr_t) addr, size) == 0);
#else
JS_ALWAYS_TRUE(munmap(addr, size) == 0);
#endif
}
#endif