diff options
author | Maria Matejka <mq@ucw.cz> | 2023-04-14 13:43:32 +0200 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2023-04-14 13:43:32 +0200 |
commit | 90b9e37bc45740e6352da7b351f6953c60feea14 (patch) | |
tree | 14d55811f8f9e66e95594d2abc527744f78cb5ec /lib | |
parent | 11069272133a6818e4b24d6f2c2ef33338ac499a (diff) | |
parent | 6c058ae40cf33d6d36c0159d0c40c9925c8e60d8 (diff) |
Merge commit '6c058ae4' into thread-next-iface
Diffstat (limited to 'lib')
-rw-r--r-- | lib/mempool.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/mempool.c b/lib/mempool.c index 5200f5e7..be98de51 100644 --- a/lib/mempool.c +++ b/lib/mempool.c @@ -185,11 +185,18 @@ lp_flush(linpool *m) { struct lp_chunk *c; - /* Move ptr to the first chunk and free all large chunks */ + /* Move ptr to the first chunk and free all other chunks */ m->current = c = m->first; m->ptr = c ? c->data : NULL; m->end = c ? c->data + LP_DATA_SIZE : NULL; + while (c && c->next) + { + struct lp_chunk *d = c->next; + c->next = d->next; + free_page(d); + } + while (c = m->first_large) { m->first_large = c->next; |