зеркало из https://github.com/mozilla/gecko-dev.git
Fix for bug 10838.
This commit is contained in:
Родитель
0a8bb17086
Коммит
980adec33f
|
@ -366,16 +366,16 @@ nsPageMgr::InitPages(nsPageCount minPages, nsPageCount maxPages)
|
||||||
|
|
||||||
nsPage* addr = NULL;
|
nsPage* addr = NULL;
|
||||||
nsPageCount size = maxPages;
|
nsPageCount size = maxPages;
|
||||||
int zero_fd;
|
mZero_fd == NULL;
|
||||||
|
|
||||||
zero_fd = open("/dev/zero", O_RDWR);
|
mZero_fd = open("/dev/zero", O_RDWR);
|
||||||
|
|
||||||
while (addr == NULL) {
|
while (addr == NULL) {
|
||||||
/* let the system place the heap */
|
/* let the system place the heap */
|
||||||
addr = (nsPage*)mmap(0, size << NS_PAGEMGR_PAGE_BITS,
|
addr = (nsPage*)mmap(0, size << NS_PAGEMGR_PAGE_BITS,
|
||||||
PROT_READ | PROT_WRITE,
|
PROT_READ | PROT_WRITE,
|
||||||
MAP_PRIVATE,
|
MAP_PRIVATE,
|
||||||
zero_fd, 0);
|
mZero_fd, 0);
|
||||||
if (addr == (nsPage*)MAP_FAILED) {
|
if (addr == (nsPage*)MAP_FAILED) {
|
||||||
addr = NULL;
|
addr = NULL;
|
||||||
size--;
|
size--;
|
||||||
|
@ -433,6 +433,7 @@ nsPageMgr::FinalizePages()
|
||||||
|
|
||||||
#else
|
#else
|
||||||
munmap((caddr_t)mMemoryBase, mPageCount << NS_PAGEMGR_PAGE_BITS);
|
munmap((caddr_t)mMemoryBase, mPageCount << NS_PAGEMGR_PAGE_BITS);
|
||||||
|
close(mZero_fd);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -191,6 +191,11 @@ class nsPageMgr : public nsIPageManager, public nsIAllocator {
|
||||||
#if defined(XP_BEOS)
|
#if defined(XP_BEOS)
|
||||||
area_id mAid;
|
area_id mAid;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if (! defined(VMS)) && (! defined(XP_BEOS)) && (! defined(XP_MAC)) && (! defined(XP_PC))
|
||||||
|
int mZero_fd;
|
||||||
|
#endif
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
Загрузка…
Ссылка в новой задаче