From 81b5118727371fd9b7a973e0d10be7e267f4d507 Mon Sep 17 00:00:00 2001 From: Jussi Kivilinna Date: Thu, 3 Aug 2017 10:01:26 -0600 Subject: [PATCH] mm_mallinfo: do heap end debug assert check with heap semaphore held --- mm/mm_heap/mm_mallinfo.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mm/mm_heap/mm_mallinfo.c b/mm/mm_heap/mm_mallinfo.c index 3ee276c917..f05fe52f16 100644 --- a/mm/mm_heap/mm_mallinfo.c +++ b/mm/mm_heap/mm_mallinfo.c @@ -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