xiaoxiang781216 commented on code in PR #21331:
URL: https://github.com/apache/nuttx/pull/21331#discussion_r4438428943


##########
mm/tlsf/mm_tlsf.c:
##########
@@ -317,13 +317,15 @@ static void memdump_backtrace(FAR struct mm_heap_s *heap,
                               FAR struct memdump_backtrace_s *buf)
 {
 #  if CONFIG_MM_BACKTRACE > 0
-  FAR struct tcb_s *tcb;
+  FAR struct tcb_s *tcb = NULL;
 #  endif
 
   buf->pid = _SCHED_GETTID();
   MM_INCSEQNO(buf);
 #  if CONFIG_MM_BACKTRACE > 0
+#    if defined(CONFIG_BUILD_FLAT) || defined(__KERNEL__)
   tcb = nxsched_get_tcb(buf->pid);
+#    endif
   if (heap->mm_procfs.backtrace ||
       (tcb && tcb->flags & TCB_FLAG_HEAP_DUMP))

Review Comment:
   if so, I think it's more simple to drop TCB_FLAG_HEAP_DUMP flag directly to 
make the behavior consistent in all build mode.



-- 
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]

Reply via email to