1
0
mirror of https://gitlab.labs.nic.cz/labs/bird.git synced 2024-05-11 16:54:54 +00:00

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.
This commit is contained in:
Martin Mares
1999-03-29 19:35:47 +00:00
parent f54801ffed
commit f5c687f791
2 changed files with 42 additions and 12 deletions

View File

@ -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 */