зеркало из https://github.com/mozilla/pjs.git
Bug 568782 add #ifdef SOLARIS for mmap/munmap changes r=igor
This commit is contained in:
Родитель
832e801c21
Коммит
e3e7455490
|
@ -164,7 +164,11 @@ StackSpace::finish()
|
||||||
#elif defined(XP_OS2)
|
#elif defined(XP_OS2)
|
||||||
DosFreeMem(base);
|
DosFreeMem(base);
|
||||||
#else
|
#else
|
||||||
|
#ifdef SOLARIS
|
||||||
munmap((caddr_t)base, CAPACITY_BYTES);
|
munmap((caddr_t)base, CAPACITY_BYTES);
|
||||||
|
#else
|
||||||
|
munmap(base, CAPACITY_BYTES);
|
||||||
|
#endif
|
||||||
#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*
|
* We don't use MAP_FIXED here, because it can cause the *replacement*
|
||||||
* of existing mappings, and we only want to create new mappings.
|
* of existing mappings, and we only want to create new mappings.
|
||||||
*/
|
*/
|
||||||
|
#ifdef SOLARIS
|
||||||
void *p = mmap((caddr_t) alignment, size, PROT_READ | PROT_WRITE,
|
void *p = mmap((caddr_t) alignment, size, PROT_READ | PROT_WRITE,
|
||||||
MAP_PRIVATE | MAP_NOSYNC | MAP_ALIGN | MAP_ANON, -1, 0);
|
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)
|
if (p == MAP_FAILED)
|
||||||
return NULL;
|
return NULL;
|
||||||
return p;
|
return p;
|
||||||
|
@ -235,7 +240,11 @@ MapPages(void *addr, size_t size)
|
||||||
static void
|
static void
|
||||||
UnmapPages(void *addr, size_t size)
|
UnmapPages(void *addr, size_t size)
|
||||||
{
|
{
|
||||||
|
#ifdef SOLARIS
|
||||||
JS_ALWAYS_TRUE(munmap((caddr_t) addr, size) == 0);
|
JS_ALWAYS_TRUE(munmap((caddr_t) addr, size) == 0);
|
||||||
|
#else
|
||||||
|
JS_ALWAYS_TRUE(munmap(addr, size) == 0);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Загрузка…
Ссылка в новой задаче