mempool:fix bug when calculating mempool delta

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
This commit is contained in:
anjiahao 2023-05-18 12:17:46 +08:00 committed by Xiang Xiao
parent 736af90370
commit 37839032cc
1 changed files with 2 additions and 1 deletions

View File

@ -319,6 +319,7 @@ mempool_multiple_init(FAR const char *name,
mpool->alloc = alloc;
mpool->free = free;
mpool->arg = arg;
mpool->delta = 0;
for (i = 0; i < npools; i++)
{
@ -340,7 +341,7 @@ mempool_multiple_init(FAR const char *name,
if (i + 1 != npools)
{
size_t delta = pools[i + 1].blocksize - pools[i].blocksize;
size_t delta = poolsize[i + 1] - poolsize[i];
if (i == 0)
{