xiaoxiang781216 commented on code in PR #6685:
URL: https://github.com/apache/incubator-nuttx/pull/6685#discussion_r930129085


##########
mm/mm_heap/mm_memdump.c:
##########
@@ -65,27 +65,31 @@ static void memdump_handler(FAR struct mm_allocnode_s 
*node, FAR void *arg)
   if ((node->preceding & MM_ALLOC_BIT) != 0)
     {
       DEBUGASSERT(node->size >= SIZEOF_MM_ALLOCNODE);
-#ifndef CONFIG_MM_BACKTRACE
+#if CONFIG_MM_BACKTRACE < 0
       if (info->pid == -1)
 #else
       if (info->pid == -1 || node->pid == info->pid)
 #endif
         {
-#ifndef CONFIG_MM_BACKTRACE
+#if CONFIG_MM_BACKTRACE < 0
           syslog(LOG_INFO, "%12zu%*p\n",
                  (size_t)node->size, MM_PTR_FMT_WIDTH,
                  ((FAR char *)node + SIZEOF_MM_ALLOCNODE));
 #else
+#  if CONFIG_MM_BACKTRACE > 0
           int i;
           FAR const char *format = " %0*p";
-          char buf[MM_BACKTRACE_DEPTH * MM_PTR_FMT_WIDTH + 1];
+#  endif
+          char buf[CONFIG_MM_BACKTRACE * MM_PTR_FMT_WIDTH + 1];
 
           buf[0] = '\0';
-          for (i = 0; i < MM_BACKTRACE_DEPTH && node->backtrace[i]; i++)
+#  if CONFIG_MM_BACKTRACE > 0
+          for (i = 0; i < CONFIG_MM_BACKTRACE && node->backtrace[i]; i++)
             {
               sprintf(buf + i * MM_PTR_FMT_WIDTH, format,
                       MM_PTR_FMT_WIDTH - 1, node->backtrace[i]);
             }
+#  endif
 
           syslog(LOG_INFO, "%6d%12zu%*p%s\n",
                  (int)node->pid, (size_t)node->size, MM_PTR_FMT_WIDTH,

Review Comment:
   @Donny9 please create a new patch to fix this, thanks.



-- 
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: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to