mempool:fix a bug when use smp on mempool backtrace
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
This commit is contained in:
parent
01c96a211f
commit
288725a5f8
@ -317,7 +317,7 @@ out_with_lock:
|
||||
|
||||
void mempool_free(FAR struct mempool_s *pool, FAR void *blk)
|
||||
{
|
||||
irqstate_t flags;
|
||||
irqstate_t flags = spin_lock_irqsave(&pool->lock);
|
||||
#if CONFIG_MM_BACKTRACE >= 0
|
||||
size_t blocksize = ALIGN_UP(pool->blocksize +
|
||||
sizeof(struct mempool_backtrace_s),
|
||||
@ -332,8 +332,6 @@ void mempool_free(FAR struct mempool_s *pool, FAR void *blk)
|
||||
pool->nalloc--;
|
||||
#endif
|
||||
|
||||
flags = spin_lock_irqsave(&pool->lock);
|
||||
|
||||
if (pool->interruptsize > blocksize)
|
||||
{
|
||||
if ((FAR char *)blk >= pool->ibase &&
|
||||
|
Loading…
Reference in New Issue
Block a user