1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-25 15:00:45 -08:00

Mps master: arenavm.c: tabs!

Copied from Perforce
 Change: 163842
 ServerID: perforce.ravenbrook.com
This commit is contained in:
Richard Kistruck 2008-01-28 15:31:46 +00:00
commit aa9346ab1c

View file

@ -682,7 +682,7 @@ static void tablePagesUsed(Index *tableBaseReturn, Index *tableLimitReturn,
*tableLimitReturn =
PageTablePageIndex(chunk,
AddrAlignUp(addrOfPageDesc(chunk, pageLimit),
ChunkPageSize(chunk)));
ChunkPageSize(chunk)));
return;
}
@ -714,8 +714,8 @@ static Res tablePagesEnsureMapped(VMChunk vmChunk,
while(BTFindLongResRange(&unmappedBaseIndex, &unmappedLimitIndex,
vmChunk->pageTableMapped,
tableCursorIndex, tableLimitIndex,
1)) {
tableCursorIndex, tableLimitIndex,
1)) {
Addr unmappedBase = TablePageIndexBase(chunk, unmappedBaseIndex);
Addr unmappedLimit = TablePageIndexBase(chunk, unmappedLimitIndex);
/* There might be a page descriptor overlapping the beginning */
@ -1213,7 +1213,7 @@ static Res pagesMarkAllocated(VMArena vmArena, VMChunk vmChunk,
while(pageIsMapped(vmChunk, mappedLimit)) {
++mappedLimit;
if (mappedLimit >= limitIndex)
break;
break;
}
AVER(mappedLimit <= limitIndex);
/* NB for loop will loop 0 times iff first page is not mapped */
@ -1232,8 +1232,8 @@ static Res pagesMarkAllocated(VMArena vmArena, VMChunk vmChunk,
}
AVER(unmappedLimit <= limitIndex);
res = vmArenaMap(vmArena, vmChunk->vm,
PageIndexBase(chunk, unmappedBase),
PageIndexBase(chunk, unmappedLimit));
PageIndexBase(chunk, unmappedBase),
PageIndexBase(chunk, unmappedLimit));
if (res != ResOK)
goto failPagesMap;
for(i = unmappedBase; i < unmappedLimit; ++i) {
@ -1250,8 +1250,8 @@ failPagesMap:
/* region from baseIndex to mappedLimit needs unmapping */
if (baseIndex < mappedLimit) {
vmArenaUnmap(vmArena, vmChunk->vm,
PageIndexBase(chunk, baseIndex),
PageIndexBase(chunk, mappedLimit));
PageIndexBase(chunk, baseIndex),
PageIndexBase(chunk, mappedLimit));
/* mark pages as free */
for(i = baseIndex; i < mappedLimit; ++i) {
TractFinish(PageTract(&chunk->pageTable[i]));
@ -1337,7 +1337,7 @@ static Res vmAllocComm(Addr *baseReturn, Tract *baseTractReturn,
sparePagesPurge(vmArena);
res = pagesMarkAllocated(vmArena, vmChunk, baseIndex, pages, pool);
if (res != ResOK)
goto failPagesMap;
goto failPagesMap;
/* win! */
} else {
goto failPagesMap;
@ -1404,13 +1404,13 @@ static void spareRangesMap(VMChunk vmChunk, Index base, Index limit,
while(!pageIsSpare(&chunk->pageTable[spareBase])) {
++spareBase;
if (spareBase >= limit)
goto done;
goto done;
}
spareLimit = spareBase;
while(pageIsSpare(&chunk->pageTable[spareLimit])) {
++spareLimit;
if (spareLimit >= limit)
break;
break;
}
f(vmChunk, spareBase, spareLimit, p);
spareBase = spareLimit;
@ -1439,7 +1439,7 @@ static void vmArenaUnmapSpareRange(VMChunk vmChunk,
}
vmArenaUnmap(VMChunkVMArena(vmChunk), vmChunk->vm,
PageIndexBase(chunk, rangeBase),
PageIndexBase(chunk, rangeLimit));
PageIndexBase(chunk, rangeLimit));
return;
}
@ -1465,8 +1465,8 @@ static void sparePagesPurge(VMArena vmArena)
while(BTFindLongResRange(&spareBaseIndex, &spareLimitIndex,
vmChunk->noSparePages,
tablePageCursor, chunk->pageTablePages,
1)) {
tablePageCursor, chunk->pageTablePages,
1)) {
Addr spareTableBase, spareTableLimit;
Index pageBase, pageLimit;
Index tablePage;
@ -1476,43 +1476,43 @@ static void sparePagesPurge(VMArena vmArena)
/* Determine whether to use initial overlapping PageStruct. */
if (spareBaseIndex > 0
&& !BTGet(vmChunk->pageTableMapped, spareBaseIndex - 1)) {
pageBase = tablePageWholeBaseIndex(chunk, spareTableBase);
pageBase = tablePageWholeBaseIndex(chunk, spareTableBase);
} else {
pageBase = tablePageBaseIndex(chunk, spareTableBase);
}
for(tablePage = spareBaseIndex; tablePage < spareLimitIndex;
++tablePage) {
/* Determine whether to use final overlapping PageStruct. */
/* Determine whether to use final overlapping PageStruct. */
if (tablePage == spareLimitIndex - 1
&& spareLimitIndex < chunk->pageTablePages
&& !BTGet(vmChunk->pageTableMapped, spareLimitIndex)) {
pageLimit =
tablePageWholeLimitIndex(chunk,
TablePageIndexBase(chunk, tablePage));
} else if (tablePage == chunk->pageTablePages - 1) {
pageLimit = chunk->pages;
} else {
pageLimit =
tablePageLimitIndex(chunk, TablePageIndexBase(chunk, tablePage));
}
if (pageBase < pageLimit) {
spareRangesMap(vmChunk, pageBase, pageLimit,
pageLimit =
tablePageWholeLimitIndex(chunk,
TablePageIndexBase(chunk, tablePage));
} else if (tablePage == chunk->pageTablePages - 1) {
pageLimit = chunk->pages;
} else {
pageLimit =
tablePageLimitIndex(chunk, TablePageIndexBase(chunk, tablePage));
}
if (pageBase < pageLimit) {
spareRangesMap(vmChunk, pageBase, pageLimit,
vmArenaUnmapSpareRange, NULL);
} else {
/* Only happens for last page occupied by the page table */
/* and only then when that last page has just the tail end */
/* part of the last page descriptor and nothing more. */
AVER(pageBase == pageLimit);
AVER(tablePage == chunk->pageTablePages - 1);
}
BTSet(vmChunk->noSparePages, tablePage);
pageBase = pageLimit;
} else {
/* Only happens for last page occupied by the page table */
/* and only then when that last page has just the tail end */
/* part of the last page descriptor and nothing more. */
AVER(pageBase == pageLimit);
AVER(tablePage == chunk->pageTablePages - 1);
}
BTSet(vmChunk->noSparePages, tablePage);
pageBase = pageLimit;
}
tablePagesUnmapUnused(vmChunk, spareTableBase, spareTableLimit);
tablePageCursor = spareLimitIndex;
if (tablePageCursor >= chunk->pageTablePages) {
AVER(tablePageCursor == chunk->pageTablePages);
break;
break;
}
}