summaryrefslogtreecommitdiffstats
path: root/lib/resource.h
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>1999-03-29 21:35:47 +0200
committerMartin Mares <mj@ucw.cz>1999-03-29 21:35:47 +0200
commitf5c687f7911501ac1efd8163fade4862dc65456c (patch)
tree04fa54e6c2e09a1f3bee060b4694c8822fcbec31 /lib/resource.h
parentf54801ffedf3d6342b37c1560502bfc24e7fe64a (diff)
downloadbird-f5c687f7911501ac1efd8163fade4862dc65456c.tar
bird-f5c687f7911501ac1efd8163fade4862dc65456c.zip
Added lp_flush() which flushes contents of a linear pool, leaving all the
memory available for subsequent allocations from the same pool. Both flushing and re-using the memory costs just few instructions.
Diffstat (limited to 'lib/resource.h')
-rw-r--r--lib/resource.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/resource.h b/lib/resource.h
index 1d83b07..1a99397 100644
--- a/lib/resource.h
+++ b/lib/resource.h
@@ -1,7 +1,7 @@
/*
* BIRD Resource Manager
*
- * (c) 1998 Martin Mares <mj@ucw.cz>
+ * (c) 1998--1999 Martin Mares <mj@ucw.cz>
*
* Can be freely distributed and used under the terms of the GNU GPL.
*/
@@ -54,6 +54,7 @@ linpool *lp_new(pool *, unsigned blk);
void *lp_alloc(linpool *, unsigned size); /* Aligned */
void *lp_allocu(linpool *, unsigned size); /* Unaligned */
void *lp_allocz(linpool *, unsigned size); /* With clear */
+void lp_flush(linpool *); /* Free everything, but leave linpool */
/* Slabs */