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 2021/07/07 03:44:11 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #4068: mm: Remove mm_heap_impl_s struct

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



##########
File path: mm/umm_heap/umm_memalign.c
##########
@@ -54,6 +54,10 @@ FAR void *memalign(size_t alignment, size_t size)
   FAR void *brkaddr;
   FAR void *mem;
 
+  /* Initialize the user heap if not yet */
+
+  umm_try_initialize();
+

Review comment:
       Kernel mode doesn't call umm_initialize in nx_start(it's impossible from technique since each process has a dedicated heap instance). Before this patch, sbrk will initialize the heap when malloc fail first time and fallback to sbrk, but we have to initialize explicitly here because tg_heap change to pointer and then no place to save the flag before we let g_heap point to some memory.




-- 
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-unsubscribe@nuttx.apache.org

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