From: Pavel Charvat Date: Wed, 28 May 2014 11:08:22 +0000 (+0200) Subject: Mempool: Do not count the struct mempool to its stats.used_size. X-Git-Tag: v6.0~26 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=5b867819167600770688dd31b3e1836e0ee50f3d;p=libucw.git Mempool: Do not count the struct mempool to its stats.used_size. --- diff --git a/ucw/mempool.c b/ucw/mempool.c index 1048686f..a66615ab 100644 --- a/ucw/mempool.c +++ b/ucw/mempool.c @@ -221,7 +221,8 @@ mp_stats(struct mempool *pool, struct mempool_stats *stats) ASSERT(stats->total_size == pool->total_size); stats->used_size = stats->chain_size[0] + stats->chain_size[1] - MP_CHUNK_TAIL * (stats->chain_count[0] + stats->chain_count[1]) - - pool->state.free[0] - pool->state.free[1]; + - pool->state.free[0] - pool->state.free[1] - sizeof(*pool); + ASSERT(stats->used_size < stats->total_size); } u64