X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/359df77829d85c6a415220fb4f21d5331323c79f..f41f820e4b3e230d9314cc4323abf59babdd4e67:/lmem.h diff --git a/lmem.h b/lmem.h index 8546dcf..8f24903 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.2 2000/06/17 11:29:38 mdw Exp $ * * Locked memory allocation * @@ -30,6 +30,9 @@ /*----- Revision history --------------------------------------------------* * * $Log: lmem.h,v $ + * Revision 1.2 2000/06/17 11:29:38 mdw + * Add arena support. + * * Revision 1.1 1999/12/22 16:02:52 mdw * Interface to allocating `locked' memory (which isn't paged out). * @@ -46,6 +49,7 @@ #include +#include #include /*----- Data structures ---------------------------------------------------*/ @@ -72,6 +76,7 @@ enum { /* --- Locked memory buffer state --- */ typedef struct lmem { + arena a; /* Arena header block */ char *p; /* Pointer to locked buffer */ l_node *l; /* Pointer to block list */ size_t sz; /* Size of locked buffer */ @@ -79,6 +84,13 @@ typedef struct lmem { int err; char *emsg; /* Error indicators */ } lmem; +/* --- Locked memory arena --- */ + +typedef struct lmem_arena { + arena a; + lmem l; +} lmem_arena; + /*----- Functions provided ------------------------------------------------*/ /* --- @l_init@ --- * @@ -151,6 +163,19 @@ extern void l_purge(lmem */*lm*/); extern int l_report(lmem */*lm*/, dstr */*d*/); +/*----- Arena management --------------------------------------------------*/ + +/* --- @l_arena@ --- * + * + * Arguments: @lmem_arena *l@ = pointer to arena block + * + * Returns: --- + * + * Use: Initializes a locked-memory arena. + */ + +extern void l_arena(lmem_arena */*l*/); + /*----- That's all, folks -------------------------------------------------*/ #ifdef __cplusplus