diff options
author | Maria Matejka <mq@ucw.cz> | 2021-12-01 13:02:44 +0100 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2021-12-01 13:04:52 +0100 |
commit | b50224a00351904f25a5105a98d56a62ed2c33a4 (patch) | |
tree | 8478675603fd2a91fb4f36f8ac2e4ffd0ac20cd3 /lib/mempool.c | |
parent | 55ee9961e0d130bb16b22b7b5acffd815f266d63 (diff) | |
parent | f772afc525156498900770ffe5a98349df89a45c (diff) |
Merge branch 'master' into HEAD
Diffstat (limited to 'lib/mempool.c')
-rw-r--r-- | lib/mempool.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/mempool.c b/lib/mempool.c index ed3ae8de..6d157e5c 100644 --- a/lib/mempool.c +++ b/lib/mempool.c @@ -46,7 +46,7 @@ struct linpool { static void lp_free(resource *); static void lp_dump(resource *); static resource *lp_lookup(resource *, unsigned long); -static size_t lp_memsize(resource *r); +static struct resmem lp_memsize(resource *r); static struct resclass lp_class = { "LinPool", @@ -302,7 +302,7 @@ lp_dump(resource *r) m->total_large); } -static size_t +static struct resmem lp_memsize(resource *r) { linpool *m = (linpool *) r; @@ -314,9 +314,11 @@ lp_memsize(resource *r) for(c=m->first_large; c; c=c->next) cnt++; - return ALLOC_OVERHEAD + sizeof(struct linpool) + - cnt * (ALLOC_OVERHEAD + sizeof(struct lp_chunk)) + - m->total + m->total_large; + return (struct resmem) { + .effective = m->total + m->total_large, + .overhead = ALLOC_OVERHEAD + sizeof(struct linpool) + + cnt * (ALLOC_OVERHEAD + sizeof(struct lp_chunk)), + }; } |