xiaoqizhan commented on code in PR #18468:
URL: https://github.com/apache/nuttx/pull/18468#discussion_r2871469583
##########
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:
@xiaoxiang781216 Because when recording the allocation information of each
memory node, it is mandatory to enable CONFIG_MM_BACKTRACE >= 0. As shown in
the following data structure definition, only in this way will the PID
information of the calling thread be saved each time memory is allocated.
```
struct mm_allocnode_s
{
mmsize_t preceding; /* Physical preceding chunk size
*/
mmsize_t size; /* Size of this chunk */
#if CONFIG_MM_BACKTRACE >= 0
pid_t pid; /* The pid for caller */
unsigned long seqno; /* The sequence of memory malloc
*/
# if CONFIG_MM_BACKTRACE > 0
FAR void *backtrace[CONFIG_MM_BACKTRACE]; /* The backtrace buffer for
caller */
# endif
#endif
};
```
--
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]