mirror of
https://gitlab.labs.nic.cz/labs/bird.git
synced 2024-05-11 16:54:54 +00:00
Lib: Save/restore state for linpools
Also change linpool.current ptr to really point to thr current chunk.
This commit is contained in:
@@ -59,11 +59,18 @@ void mb_free(void *);
|
||||
|
||||
typedef struct linpool linpool;
|
||||
|
||||
typedef struct lp_state {
|
||||
void *current, *large;
|
||||
byte *ptr;
|
||||
} lp_state;
|
||||
|
||||
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 */
|
||||
void lp_save(linpool *m, lp_state *p); /* Save state */
|
||||
void lp_restore(linpool *m, lp_state *p); /* Restore state */
|
||||
|
||||
extern const int lp_chunk_size;
|
||||
#define LP_GAS 1024
|
||||
|
Reference in New Issue
Block a user