mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-06-16 21:41:27 +00:00
Rename the enumeration cbsfinddelete to finddelete in anticipation of it being shared between cbs and new freelist module.
Since ABQDisposition enumeration only has two values, it's better to use Bool. Copied from Perforce Change: 182347 ServerID: perforce.ravenbrook.com
This commit is contained in:
parent
fcc50ead4c
commit
e7559cf22f
14 changed files with 95 additions and 115 deletions
|
|
@ -241,17 +241,6 @@ Count ABQDepth(ABQ abq)
|
|||
}
|
||||
|
||||
|
||||
/* ABQDispositionCheck -- check method for an ABQDisposition value */
|
||||
static Bool ABQDispositionCheck(ABQDisposition disposition)
|
||||
{
|
||||
CHECKL(disposition == ABQDispositionKEEP
|
||||
|| disposition == ABQDispositionDELETE);
|
||||
UNUSED(disposition); /* <code/mpm.c#check.unused> */
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/* ABQIterate -- call 'iterate' for each element in an ABQ */
|
||||
void ABQIterate(ABQ abq, ABQIterateMethod iterate, void *closureP, Size closureS)
|
||||
{
|
||||
|
|
@ -266,11 +255,12 @@ void ABQIterate(ABQ abq, ABQIterateMethod iterate, void *closureP, Size closureS
|
|||
|
||||
while (index != in) {
|
||||
void *element = ABQElement(abq, index);
|
||||
ABQDisposition disposition = ABQDispositionNONE;
|
||||
Bool delete = FALSE;
|
||||
Bool cont;
|
||||
cont = (*iterate)(&disposition, element, closureP, closureS);
|
||||
AVERT(ABQDisposition, disposition);
|
||||
if (disposition == ABQDispositionKEEP) {
|
||||
cont = (*iterate)(&delete, element, closureP, closureS);
|
||||
AVERT(Bool, cont);
|
||||
AVERT(Bool, delete);
|
||||
if (!delete) {
|
||||
if (copy != index)
|
||||
mps_lib_memcpy(ABQElement(abq, copy), element, abq->elementSize);
|
||||
copy = ABQNextIndex(abq, copy);
|
||||
|
|
|
|||
|
|
@ -24,8 +24,7 @@
|
|||
|
||||
typedef struct ABQStruct *ABQ;
|
||||
typedef Res (*ABQDescribeElement)(void *element, mps_lib_FILE *stream);
|
||||
typedef unsigned ABQDisposition;
|
||||
typedef Bool (*ABQIterateMethod)(ABQDisposition *dispositionReturn, void *element, void *closureP, Size closureS);
|
||||
typedef Bool (*ABQIterateMethod)(Bool *deleteReturn, void *element, void *closureP, Size closureS);
|
||||
|
||||
extern Res ABQInit(Arena arena, ABQ abq, void *owner, Count elements, Size elementSize);
|
||||
extern Bool ABQCheck(ABQ abq);
|
||||
|
|
@ -59,18 +58,6 @@ typedef struct ABQStruct
|
|||
Sig sig;
|
||||
} ABQStruct;
|
||||
|
||||
enum {
|
||||
ABQIterationCONTINUE = 1, /* continue iterating */
|
||||
ABQIterationSTOP, /* stop iterating */
|
||||
ABQIterationNONE /* no iteration (error) */
|
||||
};
|
||||
|
||||
enum {
|
||||
ABQDispositionKEEP = 1, /* keep item in queue */
|
||||
ABQDispositionDELETE, /* delete element from queue */
|
||||
ABQDispositionNONE /* no disposition (error) */
|
||||
};
|
||||
|
||||
#endif /* abq_h */
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -95,17 +95,17 @@ typedef struct TestClosureStruct {
|
|||
Res res;
|
||||
} TestClosureStruct;
|
||||
|
||||
static Bool TestDeleteCallback(ABQDisposition *dispositionReturn,
|
||||
void *element, void *closureP, Size closureS)
|
||||
static Bool TestDeleteCallback(Bool *deleteReturn, void *element,
|
||||
void *closureP, Size closureS)
|
||||
{
|
||||
TestBlock *a = (TestBlock *)element;
|
||||
TestClosure cl = (TestClosure)closureP;
|
||||
UNUSED(closureS);
|
||||
if (*a == cl->b) {
|
||||
*dispositionReturn = ABQDispositionDELETE;
|
||||
*deleteReturn = TRUE;
|
||||
cl->res = ResOK;
|
||||
} else {
|
||||
*dispositionReturn = ABQDispositionKEEP;
|
||||
*deleteReturn = FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -690,13 +690,14 @@ void CBSIterate(CBS cbs, CBSIterateMethod iterate,
|
|||
}
|
||||
|
||||
|
||||
/* CBSFindDeleteCheck -- check method for a CBSFindDelete value */
|
||||
/* FindDeleteCheck -- check method for a FindDelete value */
|
||||
|
||||
static Bool CBSFindDeleteCheck(CBSFindDelete findDelete)
|
||||
Bool FindDeleteCheck(FindDelete findDelete)
|
||||
{
|
||||
CHECKL(findDelete == CBSFindDeleteNONE || findDelete == CBSFindDeleteLOW
|
||||
|| findDelete == CBSFindDeleteHIGH
|
||||
|| findDelete == CBSFindDeleteENTIRE);
|
||||
CHECKL(findDelete == FindDeleteNONE
|
||||
|| findDelete == FindDeleteLOW
|
||||
|| findDelete == FindDeleteHIGH
|
||||
|| findDelete == FindDeleteENTIRE);
|
||||
UNUSED(findDelete); /* <code/mpm.c#check.unused> */
|
||||
|
||||
return TRUE;
|
||||
|
|
@ -708,7 +709,7 @@ static Bool CBSFindDeleteCheck(CBSFindDelete findDelete)
|
|||
static void cbsFindDeleteRange(Addr *baseReturn, Addr *limitReturn,
|
||||
Addr *oldBaseReturn, Addr *oldLimitReturn,
|
||||
CBS cbs, Addr base, Addr limit, Size size,
|
||||
CBSFindDelete findDelete)
|
||||
FindDelete findDelete)
|
||||
{
|
||||
Bool callDelete = TRUE;
|
||||
|
||||
|
|
@ -718,23 +719,23 @@ static void cbsFindDeleteRange(Addr *baseReturn, Addr *limitReturn,
|
|||
AVER(base < limit);
|
||||
AVER(size > 0);
|
||||
AVER(AddrOffset(base, limit) >= size);
|
||||
AVERT(CBSFindDelete, findDelete);
|
||||
AVERT(FindDelete, findDelete);
|
||||
|
||||
switch(findDelete) {
|
||||
|
||||
case CBSFindDeleteNONE:
|
||||
case FindDeleteNONE:
|
||||
callDelete = FALSE;
|
||||
break;
|
||||
|
||||
case CBSFindDeleteLOW:
|
||||
case FindDeleteLOW:
|
||||
limit = AddrAdd(base, size);
|
||||
break;
|
||||
|
||||
case CBSFindDeleteHIGH:
|
||||
case FindDeleteHIGH:
|
||||
base = AddrSub(limit, size);
|
||||
break;
|
||||
|
||||
case CBSFindDeleteENTIRE:
|
||||
case FindDeleteENTIRE:
|
||||
/* do nothing */
|
||||
break;
|
||||
|
||||
|
|
@ -762,7 +763,7 @@ static void cbsFindDeleteRange(Addr *baseReturn, Addr *limitReturn,
|
|||
|
||||
Bool CBSFindFirst(Addr *baseReturn, Addr *limitReturn,
|
||||
Addr *oldBaseReturn, Addr *oldLimitReturn,
|
||||
CBS cbs, Size size, CBSFindDelete findDelete)
|
||||
CBS cbs, Size size, FindDelete findDelete)
|
||||
{
|
||||
Bool found;
|
||||
SplayNode node;
|
||||
|
|
@ -775,7 +776,7 @@ Bool CBSFindFirst(Addr *baseReturn, Addr *limitReturn,
|
|||
AVER(size > 0);
|
||||
AVER(SizeIsAligned(size, cbs->alignment));
|
||||
AVER(cbs->fastFind);
|
||||
AVERT(CBSFindDelete, findDelete);
|
||||
AVERT(FindDelete, findDelete);
|
||||
|
||||
METER_ACC(cbs->splaySearch, cbs->splayTreeSize);
|
||||
found = SplayFindFirst(&node, splayTreeOfCBS(cbs), &cbsTestNode,
|
||||
|
|
@ -801,7 +802,7 @@ Bool CBSFindFirst(Addr *baseReturn, Addr *limitReturn,
|
|||
|
||||
Bool CBSFindLast(Addr *baseReturn, Addr *limitReturn,
|
||||
Addr *oldBaseReturn, Addr *oldLimitReturn,
|
||||
CBS cbs, Size size, CBSFindDelete findDelete)
|
||||
CBS cbs, Size size, FindDelete findDelete)
|
||||
{
|
||||
Bool found;
|
||||
SplayNode node;
|
||||
|
|
@ -814,7 +815,7 @@ Bool CBSFindLast(Addr *baseReturn, Addr *limitReturn,
|
|||
AVER(size > 0);
|
||||
AVER(SizeIsAligned(size, cbs->alignment));
|
||||
AVER(cbs->fastFind);
|
||||
AVERT(CBSFindDelete, findDelete);
|
||||
AVERT(FindDelete, findDelete);
|
||||
|
||||
METER_ACC(cbs->splaySearch, cbs->splayTreeSize);
|
||||
found = SplayFindLast(&node, splayTreeOfCBS(cbs), &cbsTestNode,
|
||||
|
|
@ -840,7 +841,7 @@ Bool CBSFindLast(Addr *baseReturn, Addr *limitReturn,
|
|||
|
||||
Bool CBSFindLargest(Addr *baseReturn, Addr *limitReturn,
|
||||
Addr *oldBaseReturn, Addr *oldLimitReturn,
|
||||
CBS cbs, CBSFindDelete findDelete)
|
||||
CBS cbs, FindDelete findDelete)
|
||||
{
|
||||
Bool found = FALSE;
|
||||
SplayNode root;
|
||||
|
|
@ -852,7 +853,7 @@ Bool CBSFindLargest(Addr *baseReturn, Addr *limitReturn,
|
|||
AVER(baseReturn != NULL);
|
||||
AVER(limitReturn != NULL);
|
||||
AVER(cbs->fastFind);
|
||||
AVERT(CBSFindDelete, findDelete);
|
||||
AVERT(FindDelete, findDelete);
|
||||
|
||||
notEmpty = SplayRoot(&root, splayTreeOfCBS(cbs));
|
||||
if (notEmpty) {
|
||||
|
|
|
|||
|
|
@ -49,23 +49,15 @@ extern void CBSIterate(CBS cbs, CBSIterateMethod iterate,
|
|||
|
||||
extern Res CBSDescribe(CBS cbs, mps_lib_FILE *stream);
|
||||
|
||||
typedef unsigned CBSFindDelete;
|
||||
enum {
|
||||
CBSFindDeleteNONE = 1,/* don't delete after finding */
|
||||
CBSFindDeleteLOW, /* delete precise size from low end */
|
||||
CBSFindDeleteHIGH, /* delete precise size from high end */
|
||||
CBSFindDeleteENTIRE /* delete entire range */
|
||||
};
|
||||
|
||||
extern Bool CBSFindFirst(Addr *baseReturn, Addr *limitReturn,
|
||||
Addr *oldBaseReturn, Addr *oldLimitReturn,
|
||||
CBS cbs, Size size, CBSFindDelete findDelete);
|
||||
CBS cbs, Size size, FindDelete findDelete);
|
||||
extern Bool CBSFindLast(Addr *baseReturn, Addr *limitReturn,
|
||||
Addr *oldBaseReturn, Addr *oldLimitReturn,
|
||||
CBS cbs, Size size, CBSFindDelete findDelete);
|
||||
CBS cbs, Size size, FindDelete findDelete);
|
||||
extern Bool CBSFindLargest(Addr *baseReturn, Addr *limitReturn,
|
||||
Addr *oldBaseReturn, Addr *oldLimitReturn,
|
||||
CBS cbs, CBSFindDelete findDelete);
|
||||
CBS cbs, FindDelete findDelete);
|
||||
|
||||
|
||||
#endif /* cbs_h */
|
||||
|
|
|
|||
|
|
@ -317,7 +317,7 @@ static void deallocate(CBS cbs, Addr block, BT allocTable,
|
|||
|
||||
|
||||
static void find(CBS cbs, void *block, BT alloc, Size size, Bool high,
|
||||
CBSFindDelete findDelete)
|
||||
FindDelete findDelete)
|
||||
{
|
||||
Bool expected, found;
|
||||
Index expectedBase, expectedLimit;
|
||||
|
|
@ -336,23 +336,23 @@ static void find(CBS cbs, void *block, BT alloc, Size size, Bool high,
|
|||
remainderLimit = origLimit = addrOfIndex(block, expectedLimit);
|
||||
|
||||
switch(findDelete) {
|
||||
case CBSFindDeleteNONE: {
|
||||
case FindDeleteNONE: {
|
||||
/* do nothing */
|
||||
} break;
|
||||
case CBSFindDeleteENTIRE: {
|
||||
case FindDeleteENTIRE: {
|
||||
remainderBase = remainderLimit;
|
||||
} break;
|
||||
case CBSFindDeleteLOW: {
|
||||
case FindDeleteLOW: {
|
||||
expectedLimit = expectedBase + size;
|
||||
remainderBase = addrOfIndex(block, expectedLimit);
|
||||
} break;
|
||||
case CBSFindDeleteHIGH: {
|
||||
case FindDeleteHIGH: {
|
||||
expectedBase = expectedLimit - size;
|
||||
remainderLimit = addrOfIndex(block, expectedBase);
|
||||
} break;
|
||||
}
|
||||
|
||||
if (findDelete != CBSFindDeleteNONE) {
|
||||
if (findDelete != FindDeleteNONE) {
|
||||
newSize = AddrOffset(remainderBase, remainderLimit);
|
||||
}
|
||||
|
||||
|
|
@ -371,7 +371,7 @@ static void find(CBS cbs, void *block, BT alloc, Size size, Bool high,
|
|||
Insist(expectedBase == indexOfAddr(block, foundBase));
|
||||
Insist(expectedLimit == indexOfAddr(block, foundLimit));
|
||||
|
||||
if (findDelete != CBSFindDeleteNONE) {
|
||||
if (findDelete != FindDeleteNONE) {
|
||||
Insist(oldBase == origBase);
|
||||
Insist(oldLimit == origLimit);
|
||||
BTSetRange(alloc, expectedBase, expectedLimit);
|
||||
|
|
@ -397,7 +397,7 @@ extern int main(int argc, char *argv[])
|
|||
BT allocTable;
|
||||
Size size;
|
||||
Bool high;
|
||||
CBSFindDelete findDelete = CBSFindDeleteNONE;
|
||||
FindDelete findDelete = FindDeleteNONE;
|
||||
|
||||
randomize(argc, argv);
|
||||
|
||||
|
|
@ -445,10 +445,10 @@ extern int main(int argc, char *argv[])
|
|||
switch(cbsRnd(6)) {
|
||||
case 0:
|
||||
case 1:
|
||||
case 2: findDelete = CBSFindDeleteNONE; break;
|
||||
case 3: findDelete = CBSFindDeleteLOW; break;
|
||||
case 4: findDelete = CBSFindDeleteHIGH; break;
|
||||
case 5: findDelete = CBSFindDeleteENTIRE; break;
|
||||
case 2: findDelete = FindDeleteNONE; break;
|
||||
case 3: findDelete = FindDeleteLOW; break;
|
||||
case 4: findDelete = FindDeleteHIGH; break;
|
||||
case 5: findDelete = FindDeleteENTIRE; break;
|
||||
}
|
||||
find(cbs, dummyBlock, allocTable, size, high, findDelete);
|
||||
} break;
|
||||
|
|
|
|||
|
|
@ -799,6 +799,11 @@ extern AllocPattern AllocPatternRamp(void);
|
|||
extern AllocPattern AllocPatternRampCollectAll(void);
|
||||
|
||||
|
||||
/* FindDelete -- see <code/cbs.c> and <code/freelist.c> */
|
||||
|
||||
extern Bool FindDeleteCheck(FindDelete findDelete);
|
||||
|
||||
|
||||
/* Format Interface -- see <code/format.c> */
|
||||
|
||||
extern Bool FormatCheck(Format format);
|
||||
|
|
|
|||
|
|
@ -109,6 +109,7 @@ typedef struct AllocPatternStruct *AllocPattern;
|
|||
typedef struct AllocFrameStruct *AllocFrame; /* <design/alloc-frame/> */
|
||||
typedef struct ReservoirStruct *Reservoir; /* <design/reservoir/> */
|
||||
typedef struct StackContextStruct *StackContext;
|
||||
typedef unsigned FindDelete; /* <design/cbs/> */
|
||||
|
||||
|
||||
/* Arena*Method -- see <code/mpmst.h#ArenaClassStruct> */
|
||||
|
|
@ -424,6 +425,17 @@ enum {
|
|||
};
|
||||
|
||||
|
||||
/* FindDelete operations -- see <design/cbs/> */
|
||||
|
||||
enum {
|
||||
FindDeleteNONE = 1, /* don't delete after finding */
|
||||
FindDeleteLOW, /* delete precise size from low end */
|
||||
FindDeleteHIGH, /* delete precise size from high end */
|
||||
FindDeleteENTIRE, /* delete entire range */
|
||||
FindDeleteLIMIT /* not a FindDelete operation; the limit of the enum. */
|
||||
};
|
||||
|
||||
|
||||
/* Types for WriteF formats */
|
||||
/* These should be used with calls to WriteF. */
|
||||
/* These must be unpromotable types. */
|
||||
|
|
|
|||
|
|
@ -588,16 +588,16 @@ static Res MVTBufferFill(Addr *baseReturn, Addr *limitReturn,
|
|||
|
||||
|
||||
/* MVTDeleteOverlapping -- ABQIterate callback used by MVTInsert and
|
||||
* MVTDelete. It receives a Range in its closureP argument, and
|
||||
* returns the DELETE disposition for ranges in the ABQ that overlap
|
||||
* with it, and the KEEP disposition for ranges that do not.
|
||||
* MVTDelete. It receives a Range in its closureP argument, and sets
|
||||
* *deleteReturn to TRUE for ranges in the ABQ that overlap with it,
|
||||
* and FALSE for ranges that do not.
|
||||
*/
|
||||
static Bool MVTDeleteOverlapping(ABQDisposition *dispositionReturn,
|
||||
void *element, void *closureP, Size closureS)
|
||||
static Bool MVTDeleteOverlapping(Bool *deleteReturn, void *element,
|
||||
void *closureP, Size closureS)
|
||||
{
|
||||
Range oldRange, newRange;
|
||||
|
||||
AVER(dispositionReturn != NULL);
|
||||
AVER(deleteReturn != NULL);
|
||||
AVER(element != NULL);
|
||||
AVER(closureP != NULL);
|
||||
UNUSED(closureS);
|
||||
|
|
@ -605,12 +605,7 @@ static Bool MVTDeleteOverlapping(ABQDisposition *dispositionReturn,
|
|||
oldRange = element;
|
||||
newRange = closureP;
|
||||
|
||||
if (RangesOverlap(oldRange, newRange)) {
|
||||
*dispositionReturn = ABQDispositionDELETE;
|
||||
} else {
|
||||
*dispositionReturn = ABQDispositionKEEP;
|
||||
}
|
||||
|
||||
*deleteReturn = RangesOverlap(oldRange, newRange);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -247,7 +247,7 @@ static Bool MVFFFindFirstFree(Addr *baseReturn, Addr *limitReturn,
|
|||
MVFF mvff, Size size)
|
||||
{
|
||||
Bool foundBlock;
|
||||
CBSFindDelete findDelete;
|
||||
FindDelete findDelete;
|
||||
Addr oldBase, oldLimit;
|
||||
|
||||
AVER(baseReturn != NULL);
|
||||
|
|
@ -256,7 +256,7 @@ static Bool MVFFFindFirstFree(Addr *baseReturn, Addr *limitReturn,
|
|||
AVER(size > 0);
|
||||
AVER(SizeIsAligned(size, PoolAlignment(MVFF2Pool(mvff))));
|
||||
|
||||
findDelete = mvff->slotHigh ? CBSFindDeleteHIGH : CBSFindDeleteLOW;
|
||||
findDelete = mvff->slotHigh ? FindDeleteHIGH : FindDeleteLOW;
|
||||
|
||||
foundBlock =
|
||||
(mvff->firstFit ? CBSFindFirst : CBSFindLast)
|
||||
|
|
@ -370,7 +370,7 @@ static Res MVFFBufferFill(Addr *baseReturn, Addr *limitReturn,
|
|||
|
||||
/* Hoping the largest is big enough, delete it and return if small. */
|
||||
foundBlock = CBSFindLargest(&base, &limit, &oldBase, &oldLimit,
|
||||
CBSOfMVFF(mvff), CBSFindDeleteENTIRE);
|
||||
CBSOfMVFF(mvff), FindDeleteENTIRE);
|
||||
if (foundBlock && AddrOffset(base, limit) < size) {
|
||||
Addr newBase, newLimit;
|
||||
foundBlock = FALSE;
|
||||
|
|
@ -388,7 +388,7 @@ static Res MVFFBufferFill(Addr *baseReturn, Addr *limitReturn,
|
|||
if (res != ResOK)
|
||||
return res;
|
||||
foundBlock = CBSFindLargest(&base, &limit, &oldBase, &oldLimit,
|
||||
CBSOfMVFF(mvff), CBSFindDeleteENTIRE);
|
||||
CBSOfMVFF(mvff), FindDeleteENTIRE);
|
||||
AVER(foundBlock); /* We will find the new segment. */
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -92,24 +92,15 @@ If the queue is full, return ``TRUE``, otherwise return ``FALSE``.
|
|||
|
||||
Return the number of elements in the queue.
|
||||
|
||||
``typedef unsigned ABQDisposition``
|
||||
|
||||
An enumerated value returned by a function of type
|
||||
``ABQIterateMethod`` describing what must happen to an element of a
|
||||
queue during the iteration. The value ``ABQDispositionKEEP`` means
|
||||
that the element must be kept in the queue; ``ABQDispositionDELETE``
|
||||
means that the element must be deleted from the queue.
|
||||
|
||||
``typedef Bool (*ABQIterateMethod)(ABQDisposition *dispositionReturn, void *element, void *closureP, Size closureS)``
|
||||
``typedef Bool (*ABQIterateMethod)(Bool *deleteReturn, void *element, void *closureP, Size closureS)``
|
||||
|
||||
A callback function for ``ABQIterate()``. The parameter ``element`` is
|
||||
an element in the queue, and ``closureP`` and ``closureS`` are the
|
||||
values that were originally passed to ``ABQIterate()``. This function
|
||||
must set ``*dispositionReturn`` to ``ABQDispositionKEEP`` if
|
||||
``element`` must be kept in the queue, or ``ABQDispositionDELETE`` if
|
||||
``element`` must be deleted from the queue. It must return ``TRUE`` if
|
||||
the iteration must continue, or ``FALSE`` if the iteration must stop
|
||||
after processing ``element``.
|
||||
must set ``*deleteReturn`` to ``FALSE`` if ``element`` must be kept in
|
||||
the queue, or ``TRUE`` if ``element`` must be deleted from the queue.
|
||||
It must return ``TRUE`` if the iteration must continue, or ``FALSE``
|
||||
if the iteration must stop after processing ``element``.
|
||||
|
||||
``void ABQIterate(ABQ abq, ABQIterateMethod iterate, void *closureP, Size closureS)``
|
||||
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ the contiguous ranges in order, as well as the structure of the
|
|||
underlying splay tree implementation. It is provided for debugging
|
||||
purposes only.
|
||||
|
||||
``Bool CBSFindFirst(Addr *baseReturn, Addr *limitReturn, Addr *oldBaseReturn, Addr *oldLimitReturn, CBS cbs, Size size, CBSFindDelete findDelete)``
|
||||
``Bool CBSFindFirst(Addr *baseReturn, Addr *limitReturn, Addr *oldBaseReturn, Addr *oldLimitReturn, CBS cbs, Size size, FindDelete findDelete)``
|
||||
|
||||
_`.function.cbs.find.first`: The ``CBSFindFirst()`` function locates
|
||||
the first block (in address order) within the CBS of at least the
|
||||
|
|
@ -174,22 +174,22 @@ the range. The value of ``findDelete`` must come from this
|
|||
enumeration::
|
||||
|
||||
enum {
|
||||
CBSFindDeleteNONE, /* don't delete after finding */
|
||||
CBSFindDeleteLOW, /* delete precise size from low end */
|
||||
CBSFindDeleteHIGH, /* delete precise size from high end */
|
||||
CBSFindDeleteENTIRE /* delete entire range */
|
||||
FindDeleteNONE, /* don't delete after finding */
|
||||
FindDeleteLOW, /* delete precise size from low end */
|
||||
FindDeleteHIGH, /* delete precise size from high end */
|
||||
FindDeleteENTIRE /* delete entire range */
|
||||
};
|
||||
|
||||
The old range of the block from which the found range was deleted is
|
||||
returned via the ``oldBaseReturn`` and ``oldLimitReturn`` arguments.
|
||||
(If ``findDelete`` is ``CBSFindDeleteNONE``, then these will be
|
||||
identical to the range returned via the ``baseReturn`` and
|
||||
``limitReturn`` arguments.)
|
||||
(If ``findDelete`` is ``FindDeleteNONE`` or ``FindDeleteENTIRE``, then
|
||||
these will be identical to the range returned via the ``baseReturn``
|
||||
and ``limitReturn`` arguments.)
|
||||
|
||||
``CBSFindFirst()`` requires that ``fastFind`` was true when
|
||||
``CBSInit()`` was called.
|
||||
|
||||
``Bool CBSFindLast(Addr *baseReturn, Addr *limitReturn, Addr *oldBaseReturn, Addr *oldLimitReturn, CBS cbs, Size size, CBSFindDelete findDelete)``
|
||||
``Bool CBSFindLast(Addr *baseReturn, Addr *limitReturn, Addr *oldBaseReturn, Addr *oldLimitReturn, CBS cbs, Size size, FindDelete findDelete)``
|
||||
|
||||
_`.function.cbs.find.last`: The ``CBSFindLast()`` function locates the
|
||||
last block (in address order) within the CBS of at least the specified
|
||||
|
|
@ -200,7 +200,7 @@ arguments, and returns ``TRUE``. If there is no such block, it returns
|
|||
Like ``CBSFindFirst()``, it optionally deletes the range, and requires
|
||||
that ``fastFind`` was true when ``CBSInit()`` was called.
|
||||
|
||||
``Bool CBSFindLargest(Addr *baseReturn, Addr *limitReturn, Addr *oldBaseReturn, Addr *oldLimitReturn, CBS cbs, CBSFindDelete findDelete)``
|
||||
``Bool CBSFindLargest(Addr *baseReturn, Addr *limitReturn, Addr *oldBaseReturn, Addr *oldLimitReturn, CBS cbs, FindDelete findDelete)``
|
||||
|
||||
_`.function.cbs.find.largest`: The ``CBSFindLargest()`` function
|
||||
locates the largest block within the CBS, returns its range via the
|
||||
|
|
@ -208,8 +208,8 @@ locates the largest block within the CBS, returns its range via the
|
|||
there are no blocks in the CBS, it returns ``FALSE``.
|
||||
|
||||
Like ``CBSFindFirst()``, it optionally deletes the range (specifying
|
||||
``CBSFindDeleteLOW`` or ``CBSFindDeleteHIGH`` has the same effect as
|
||||
``CBSFindDeleteENTIRE``), and requires that ``fastFind`` was true when
|
||||
``FindDeleteLOW`` or ``FindDeleteHIGH`` has the same effect as
|
||||
``FindDeleteENTIRE``), and requires that ``fastFind`` was true when
|
||||
``CBSInit()`` was called.
|
||||
|
||||
|
||||
|
|
|
|||
6
mps/manual/source/design/freelist.rst
Normal file
6
mps/manual/source/design/freelist.rst
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
.. index::
|
||||
pair: free list allocator; design
|
||||
|
||||
.. _design-freelist:
|
||||
|
||||
.. include:: ../../converted/freelist.rst
|
||||
|
|
@ -10,6 +10,7 @@ Design
|
|||
cbs
|
||||
config
|
||||
critical-path
|
||||
freelist
|
||||
guide.hex.trans
|
||||
keyword-arguments
|
||||
range
|
||||
|
|
|
|||
Loading…
Reference in a new issue