You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/04/22 02:52:51 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #843: Fix heap corruption

xiaoxiang781216 commented on a change in pull request #843:
URL: https://github.com/apache/incubator-nuttx/pull/843#discussion_r412630488



##########
File path: include/nuttx/mm/mm.h
##########
@@ -258,7 +259,8 @@ struct mm_heap_s
 
   struct mm_freenode_s mm_nodelist[MM_NNODES];
 
-#if defined(CONFIG_BUILD_FLAT) || defined(__KERNEL__)
+#if defined(CONFIG_BUILD_FLAT) || defined(CONFIG_BUILD_PROTECTED) \
+  || defined(__KERNEL__)

Review comment:
       From your report, it's very important to keep mm_heap_s layout consistent in all the memory model. So I think the more safe fix is that:
   1.Remove #ifdef/#endif around "struct mm_delaynode_s" and "struct mm_delaynode_s *mm_delaylist"
   2.Rremove #ifdef/#endif around nuttx/mm/mm_heap/mm_initialize.c:181




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

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