yamt commented on a change in pull request #266: Fix mm for clang URL: https://github.com/apache/incubator-nuttx/pull/266#discussion_r378871429
########## File path: mm/mm_heap/mm_mallinfo.c ########## @@ -97,17 +98,29 @@ int mm_mallinfo(FAR struct mm_heap_s *heap, FAR struct mallinfo *info) if ((node->preceding & MM_ALLOC_BIT) != 0) { + DEBUGASSERT(node->size >= SIZEOF_MM_ALLOCNODE); uordblks += node->size; } else { + FAR struct mm_freenode_s *fnode; + DEBUGASSERT(node->size >= SIZEOF_MM_FREENODE); + fnode = (FAR void *)node; + DEBUGASSERT(fnode->blink->flink == fnode); + DEBUGASSERT(fnode->blink->size <= fnode->size); + DEBUGASSERT(fnode->flink == NULL || + fnode->flink->blink == fnode); + DEBUGASSERT(fnode->flink == NULL || + fnode->flink->size == 0 || + fnode->flink->size >= fnode->size); ordblks++; fordblks += node->size; if (node->size > mxordblk) { mxordblk = node->size; } } + DEBUGASSERT(prev == NULL || prev->size == (node->preceding & ~MM_ALLOC_BIT)); Review comment: thank you. fixed. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services