X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/359df77829d85c6a415220fb4f21d5331323c79f..02dfbd5b7af7816959dbd39c1fe628451204e35f:/lmem.h diff --git a/lmem.h b/lmem.h index 8546dcf..f7cb6ed 100644 --- a/lmem.h +++ b/lmem.h @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: lmem.h,v 1.1 1999/12/22 16:02:52 mdw Exp $ + * $Id: lmem.h,v 1.5 2004/04/08 01:36:15 mdw Exp $ * * Locked memory allocation * @@ -27,14 +27,6 @@ * MA 02111-1307, USA. */ -/*----- Revision history --------------------------------------------------* - * - * $Log: lmem.h,v $ - * Revision 1.1 1999/12/22 16:02:52 mdw - * Interface to allocating `locked' memory (which isn't paged out). - * - */ - #ifndef CATACOMB_LMEM_H #define CATACOMB_LMEM_H @@ -46,6 +38,7 @@ #include +#include #include /*----- Data structures ---------------------------------------------------*/ @@ -65,13 +58,13 @@ typedef struct l_node { unsigned f; /* Various flags */ } l_node; -enum { - LF_ALLOC = 1 -}; +#define LF_ALLOC 1u /* --- Locked memory buffer state --- */ typedef struct lmem { + arena a; /* Arena header block */ + unsigned f; /* Various flags */ char *p; /* Pointer to locked buffer */ l_node *l; /* Pointer to block list */ size_t sz; /* Size of locked buffer */ @@ -79,6 +72,8 @@ typedef struct lmem { int err; char *emsg; /* Error indicators */ } lmem; +#define LF_LOCKED 1u + /*----- Functions provided ------------------------------------------------*/ /* --- @l_init@ --- * @@ -135,6 +130,17 @@ extern void l_free(lmem */*lm*/, void */*p*/); extern void l_purge(lmem */*lm*/); +/* --- @l_destroy@ --- * + * + * Arguments: @lmem *lm@ = pointer to locked memory descriptor + * + * Returns: --- + * + * Use: Disposes of a locked memory arena permanently. + */ + +extern void l_destroy(lmem */*lm*/); + /* --- @l_report@ --- * * * Arguments: @lmem *lm@ = pointer to locked memory descriptor