xiaoxiang781216 commented on code in PR #18468:
URL: https://github.com/apache/nuttx/pull/18468#discussion_r2870805774
##########
mm/mm_heap/mm_memdump.c:
##########
@@ -301,6 +324,18 @@ void mm_memdump(FAR struct mm_heap_s *heap,
{
syslog(LOG_INFO, "Dump allocated orphan nodes\n");
}
+#if CONFIG_MM_BACKTRACE >= 0
+ else if (pid == PID_MM_ALL_PID)
+ {
+ syslog(LOG_INFO, "Dump all pid memory allocated\n");
+ struct memdump_tcb_arg_s tcb_arg;
+ tcb_arg.heap = heap;
+ tcb_arg.seqmin = dump->seqmin;
+ tcb_arg.seqmax = dump->seqmax;
+ nxsched_foreach(memdump_tcb_handler, &tcb_arg);
Review Comment:
why not reuse memdump_handler, the current approach has two loop(tcb + mem)
which is very slower than one loop.
##########
include/malloc.h:
##########
@@ -35,6 +35,9 @@
/* Special PID to query the info about alloc, free and mempool */
+#if CONFIG_MM_BACKTRACE >= 0
Review Comment:
why need check CONFIG_MM_BACKTRACE
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]