mm/mempool: Count the expend block overhead in mempool_info

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2023-05-28 23:47:14 +08:00 committed by Petro Karashchenko
parent 0572bc4d03
commit 313f79d55e

View file

@ -369,6 +369,7 @@ int mempool_info(FAR struct mempool_s *pool, FAR struct mempoolinfo_s *info)
info->aordblks = pool->nalloc;
#endif
info->arena =
mempool_queue_lenth(&pool->equeue) * sizeof(sq_entry_t) +
(info->aordblks + info->ordblks + info->iordblks) * blocksize;
spin_unlock_irqrestore(&pool->lock, flags);
info->sizeblks = blocksize;