mm_mallinfo: do heap end debug assert check with heap semaphore held

This commit is contained in:
Jussi Kivilinna 2017-08-03 10:01:26 -06:00 committed by Gregory Nutt
parent 027a446158
commit 81b5118727

View File

@ -109,10 +109,12 @@ int mm_mallinfo(FAR struct mm_heap_s *heap, FAR struct mallinfo *info)
}
}
minfo("region=%d node=%p heapend=%p\n",
region, node, heap->mm_heapend[region]);
DEBUGASSERT(node == heap->mm_heapend[region]);
mm_givesemaphore(heap);
minfo("region=%d node=%p heapend=%p\n", region, node, heap->mm_heapend[region]);
DEBUGASSERT(node == heap->mm_heapend[region]);
uordblks += SIZEOF_MM_ALLOCNODE; /* account for the tail node */
}
#undef region