mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-04-27 16:51:06 -07:00
Remove unused functions landcreate and landdestroy.
Copied from Perforce Change: 192603 ServerID: perforce.ravenbrook.com
This commit is contained in:
parent
6255d80714
commit
52d40d2fed
6 changed files with 37 additions and 103 deletions
|
|
@ -120,58 +120,6 @@ Res LandInit(Land land, LandClass klass, Arena arena, Align alignment, void *own
|
|||
}
|
||||
|
||||
|
||||
/* LandCreate -- allocate and initialize land
|
||||
*
|
||||
* See <design/land/#function.create>
|
||||
*/
|
||||
|
||||
Res LandCreate(Land *landReturn, Arena arena, LandClass klass, Align alignment, void *owner, ArgList args)
|
||||
{
|
||||
Res res;
|
||||
Land land;
|
||||
void *p;
|
||||
|
||||
AVER(landReturn != NULL);
|
||||
AVERT(Arena, arena);
|
||||
AVERT(LandClass, klass);
|
||||
|
||||
res = ControlAlloc(&p, arena, klass->size);
|
||||
if (res != ResOK)
|
||||
goto failAlloc;
|
||||
land = p;
|
||||
|
||||
res = LandInit(land, klass, arena, alignment, owner, args);
|
||||
if (res != ResOK)
|
||||
goto failInit;
|
||||
|
||||
*landReturn = land;
|
||||
return ResOK;
|
||||
|
||||
failInit:
|
||||
ControlFree(arena, land, klass->size);
|
||||
failAlloc:
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
/* LandDestroy -- finish and deallocate land
|
||||
*
|
||||
* See <design/land/#function.destroy>
|
||||
*/
|
||||
|
||||
void LandDestroy(Land land)
|
||||
{
|
||||
Arena arena;
|
||||
Size size;
|
||||
|
||||
AVERC(Land, land);
|
||||
arena = land->arena;
|
||||
size = ClassOfPoly(Land, land)->size;
|
||||
LandFinish(land);
|
||||
ControlFree(arena, land, size);
|
||||
}
|
||||
|
||||
|
||||
/* LandFinish -- finish land
|
||||
*
|
||||
* See <design/land/#function.finish>
|
||||
|
|
|
|||
|
|
@ -973,8 +973,6 @@ extern Bool LandCheck(Land land);
|
|||
#define LandAlignment(land) ((land)->alignment)
|
||||
extern Size LandSize(Land land);
|
||||
extern Res LandInit(Land land, LandClass klass, Arena arena, Align alignment, void *owner, ArgList args);
|
||||
extern Res LandCreate(Land *landReturn, Arena arena, LandClass klass, Align alignment, void *owner, ArgList args);
|
||||
extern void LandDestroy(Land land);
|
||||
extern void LandFinish(Land land);
|
||||
extern Res LandInsert(Range rangeReturn, Land land, Range range);
|
||||
extern Res LandDelete(Range rangeReturn, Land land, Range range);
|
||||
|
|
|
|||
|
|
@ -62,40 +62,37 @@ External types
|
|||
``typedef struct CBSStruct *CBS``
|
||||
|
||||
_`.type.cbs`: The type of coalescing block structures. A ``CBSStruct``
|
||||
may be embedded in another structure, or you can create it using
|
||||
``LandCreate()``.
|
||||
is typically embedded in another structure.
|
||||
|
||||
|
||||
External functions
|
||||
..................
|
||||
External classes
|
||||
................
|
||||
|
||||
``LandClass CBSLandClassGet(void)``
|
||||
``CLASS(CBS)``
|
||||
|
||||
_`.function.class`: The function ``CBSLandClassGet()`` returns the CBS
|
||||
class, a subclass of ``LandClass`` suitable for passing to
|
||||
``LandCreate()`` or ``LandInit()``.
|
||||
_`.class.cbs`: The CBS class, a subclass of ``CLASS(Land)`` suitable
|
||||
for passing to ``LandInit()``.
|
||||
|
||||
``LandClass CBSFastLandClassGet(void)``
|
||||
``CLASS(CBSFast)``
|
||||
|
||||
_`.function.class.fast`: Returns a subclass of ``CBSLandClass`` that
|
||||
maintains, for each subtree, the size of the largest block in that
|
||||
subtree. This enables the ``LandFindFirst()``, ``LandFindLast()``, and
|
||||
``LandFindLargest()`` generic functions.
|
||||
_`.class.fast`: A subclass of ``CLASS(CBS)`` that maintains, for each
|
||||
subtree, the size of the largest block in that subtree. This enables
|
||||
the ``LandFindFirst()``, ``LandFindLast()``, and ``LandFindLargest()``
|
||||
generic functions.
|
||||
|
||||
``LandClass CBSZonedLandClassGet(void)``
|
||||
``CLASS(CBSZoned)``
|
||||
|
||||
_`.function.class.zoned`: Returns a subclass of ``CBSFastLandClass`` that
|
||||
maintains, for each subtree, the union of the zone sets of all ranges
|
||||
in that subtree. This enables the ``LandFindInZones()`` generic
|
||||
function.
|
||||
_`.class.zoned`: A subclass of ``CLASS(CBSFast)`` that maintains, for
|
||||
each subtree, the union of the zone sets of all ranges in that
|
||||
subtree. This enables the ``LandFindInZones()`` generic function.
|
||||
|
||||
|
||||
|
||||
Keyword arguments
|
||||
.................
|
||||
|
||||
When initializing a CBS, ``LandCreate()`` and ``LandInit()`` take the
|
||||
following optional keyword arguments:
|
||||
When initializing a CBS, ``LandInit()`` takes the following optional
|
||||
keyword arguments:
|
||||
|
||||
* ``CBSBlockPool`` (type ``Pool``) is the pool from which the CBS
|
||||
block descriptors will be allocated. If omitted, a new MFS pool is
|
||||
|
|
|
|||
|
|
@ -46,31 +46,29 @@ abstract data type, so the interface consists of the generic functions
|
|||
for lands. See design.mps.land_.
|
||||
|
||||
|
||||
External types
|
||||
..............
|
||||
Types
|
||||
.....
|
||||
|
||||
``typedef struct FailoverStruct *Failover``
|
||||
|
||||
_`.type.failover`: The type of fail-over allocator structures. A
|
||||
``FailoverStruct`` may be embedded in another structure, or you can
|
||||
create it using ``LandCreate()``.
|
||||
``FailoverStruct`` is typically embedded in another structure.
|
||||
|
||||
|
||||
External functions
|
||||
..................
|
||||
Classes
|
||||
.......
|
||||
|
||||
``LandClass FailoverLandClassGet(void)``
|
||||
``CLASS(Failover)``
|
||||
|
||||
_`.function.class`: The function ``FailoverLandClassGet()`` returns
|
||||
the fail-over allocator class, a subclass of ``LandClass`` suitable
|
||||
for passing to ``LandCreate()`` or ``LandInit()``.
|
||||
_`.class`: The fail-over allocator class, a subclass of
|
||||
``CLASS(Land)`` suitable for passing to ``LandInit()``.
|
||||
|
||||
|
||||
Keyword arguments
|
||||
.................
|
||||
|
||||
When initializing a fail-over allocator, ``LandCreate()`` and
|
||||
``LandInit()`` require these two keyword arguments:
|
||||
When initializing a fail-over allocator, ``LandInit()`` requires these
|
||||
two keyword arguments:
|
||||
|
||||
* ``FailoverPrimary`` (type ``Land``) is the primary land.
|
||||
|
||||
|
|
|
|||
|
|
@ -67,26 +67,24 @@ Types
|
|||
|
||||
``typedef struct FreelistStruct *Freelist``
|
||||
|
||||
_`.type.freelist`: The type of free lists. A ``FreelistStruct`` may be
|
||||
embedded in another structure, or you can create it using
|
||||
``LandCreate()``.
|
||||
_`.type.freelist`: The type of free lists. A ``FreelistStruct`` is
|
||||
typically embedded in another structure.
|
||||
|
||||
|
||||
External functions
|
||||
..................
|
||||
Classes
|
||||
.......
|
||||
|
||||
``LandClass FreelistLandClassGet(void)``
|
||||
``CLASS(Freelist)``
|
||||
|
||||
_`.function.class`: The function ``FreelistLandClassGet()`` returns
|
||||
the free list class, a subclass of ``LandClass`` suitable for passing
|
||||
to ``LandCreate()`` or ``LandInit()``.
|
||||
_`.class`: The free list class, a subclass of ``CLASS(Land)`` suitable
|
||||
for passing to ``LandInit()``.
|
||||
|
||||
|
||||
Keyword arguments
|
||||
.................
|
||||
|
||||
When initializing a free list, ``LandCreate()`` and ``LandInit()``
|
||||
take no keyword arguments. Pass ``mps_args_none``.
|
||||
When initializing a free list, ``LandInit()`` takes no keyword
|
||||
arguments. Pass ``mps_args_none``.
|
||||
|
||||
|
||||
Implementation
|
||||
|
|
@ -172,7 +170,7 @@ Document History
|
|||
Copyright and License
|
||||
---------------------
|
||||
|
||||
Copyright © 2013-2014 Ravenbrook Limited <http://www.ravenbrook.com/>.
|
||||
Copyright © 2013-2016 Ravenbrook Limited <http://www.ravenbrook.com/>.
|
||||
All rights reserved. This is an open source license. Contact
|
||||
Ravenbrook for commercial licensing options.
|
||||
|
||||
|
|
|
|||
|
|
@ -115,11 +115,6 @@ _`.function.create`: ``LandCreate()`` allocates memory for a land
|
|||
structure of the given class in ``arena``, and then passes all
|
||||
parameters to ``LandInit()``.
|
||||
|
||||
``void LandDestroy(Land land)``
|
||||
|
||||
_`.function.destroy`: ``LandDestroy()`` calls ``LandFinish()`` to
|
||||
finish the land structure, and then frees its memory.
|
||||
|
||||
``void LandFinish(Land land)``
|
||||
|
||||
_`.function.finish`: ``LandFinish()`` finishes the land structure and
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue