Skip to content

Commit

Permalink
malloc:if malloc filed need print leak memory detatls
Browse files Browse the repository at this point in the history
Signed-off-by: anjiahao <[email protected]>
  • Loading branch information
anjiahao1 authored and jasonbu committed Oct 11, 2024
1 parent 976c417 commit b4b30dd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mm/mm_heap/mm_malloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,9 @@ FAR void *mm_malloc(FAR struct mm_heap_s *heap, size_t size)
# endif
# ifdef CONFIG_MM_DUMP_DETAILS_ON_FAILURE
mm_memdump(heap, &dump);
mwarn("Dump leak memory(thread exit, but memory not free):\n");
dump.pid = PID_MM_LEAK;
mm_memdump(heap, &dump);
# endif
#endif
#ifdef CONFIG_MM_PANIC_ON_FAILURE
Expand Down

0 comments on commit b4b30dd

Please sign in to comment.