diff --git a/mm/mm_heap/mm_foreach.c b/mm/mm_heap/mm_foreach.c index b529bfddbdd..f9883bde0a4 100644 --- a/mm/mm_heap/mm_foreach.c +++ b/mm/mm_heap/mm_foreach.c @@ -94,6 +94,7 @@ void mm_foreach(FAR struct mm_heap_s *heap, mm_node_handler_t handler, minfo("region=%d node=%p heapend=%p\n", region, node, heap->mm_heapend[region]); DEBUGASSERT(node == heap->mm_heapend[region]); + handler(node, arg); mm_unlock(heap); } diff --git a/mm/mm_heap/mm_mallinfo.c b/mm/mm_heap/mm_mallinfo.c index 5295c50e14b..66f126ee725 100644 --- a/mm/mm_heap/mm_mallinfo.c +++ b/mm/mm_heap/mm_mallinfo.c @@ -140,11 +140,6 @@ struct mallinfo mm_mallinfo(FAR struct mm_heap_s *heap) struct mallinfo info; #if CONFIG_MM_HEAP_MEMPOOL_THRESHOLD != 0 struct mallinfo poolinfo; -#endif -#if CONFIG_MM_REGIONS > 1 - int region = heap->mm_nregions; -#else -# define region 1 #endif memset(&info, 0, sizeof(info)); @@ -158,15 +153,6 @@ struct mallinfo mm_mallinfo(FAR struct mm_heap_s *heap) info.fordblks += poolinfo.fordblks; #endif - /* Account for the heap->mm_heapend[region] node overhead and the - * heap->mm_heapstart[region]->preceding: - * heap->mm_heapend[region] overhead size = OVERHEAD_MM_ALLOCNODE - * heap->mm_heapstart[region]->preceding size = sizeof(mmsize_t) - * and SIZEOF_MM_ALLOCNODE = OVERHEAD_MM_ALLOCNODE + sizeof(mmsize_t). - */ - - info.uordblks += region * SIZEOF_MM_ALLOCNODE; - DEBUGASSERT((size_t)info.uordblks + info.fordblks == heap->mm_heapsize); return info;