You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2022/02/26 06:32:56 UTC

[incubator-nuttx] 06/06: mm/mm_malloc: dump all allocated memory info when malloc failed

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 018d7d605c4a1bb4b419a4421020394c3ddb82a2
Author: Jiuzhu Dong <do...@xiaomi.com>
AuthorDate: Fri Jan 28 14:11:47 2022 +0800

    mm/mm_malloc: dump all allocated memory info when malloc failed
    
    Signed-off-by: Jiuzhu Dong <do...@xiaomi.com>
---
 mm/mm_heap/mm_malloc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/mm/mm_heap/mm_malloc.c b/mm/mm_heap/mm_malloc.c
index 9a94910..d392c2a 100644
--- a/mm/mm_heap/mm_malloc.c
+++ b/mm/mm_heap/mm_malloc.c
@@ -244,6 +244,8 @@ FAR void *mm_malloc(FAR struct mm_heap_s *heap, size_t size)
   else
     {
       mwarn("WARNING: Allocation failed, size %zu\n", alignsize);
+      mm_memdump(heap, -1);
+      DEBUGASSERT(false);
     }
 #endif