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/05 07:19:47 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 opened a new pull request #4068: mm: Remove mm_heap_impl_s struct

xiaoxiang781216 opened a new pull request #4068:
URL: https://github.com/apache/incubator-nuttx/pull/4068


   ## Summary
   since it's more simple to make mm_heap_s opaque outside of mm
   
   ## Impact
   mm_heap_s become opaque struct
   
   ## Testing
   ostest
   


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



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

Posted by GitBox <gi...@apache.org>.
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



[GitHub] [incubator-nuttx] davids5 commented on pull request #4068: mm: Remove mm_heap_impl_s struct

Posted by GitBox <gi...@apache.org>.
davids5 commented on pull request #4068:
URL: https://github.com/apache/incubator-nuttx/pull/4068#issuecomment-875034458


   @xiaoxiang781216  I just noticed that the change adding the name is not reflected in the mm/README.txt nor the titale blocks
   
   ```
   /****************************************************************************
    * Name: mm_initialize
    *
    * Description:
    *   Initialize the selected heap data structures, providing the initial
    *   heap region.
    *
    * Input Parameters:
    *   heap      - The selected heap
    *   heapstart - Start of the initial heap region
    *   heapsize  - Size of the initial heap region
    *
    * Returned Value:
    *   None
    *
    * Assumptions:
    *
    ****************************************************************************/
   ```


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



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

Posted by GitBox <gi...@apache.org>.
Ouss4 commented on a change in pull request #4068:
URL: https://github.com/apache/incubator-nuttx/pull/4068#discussion_r665114256



##########
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:
       Thanks for the explanation!




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



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

Posted by GitBox <gi...@apache.org>.
Ouss4 commented on a change in pull request #4068:
URL: https://github.com/apache/incubator-nuttx/pull/4068#discussion_r664943668



##########
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:
       ```suggestion
     /* Initialize the user heap if it wasn't yet. */
   
     umm_try_initialize();
   ```
   
   Why is this required here?




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



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

Posted by GitBox <gi...@apache.org>.
Ouss4 commented on a change in pull request #4068:
URL: https://github.com/apache/incubator-nuttx/pull/4068#discussion_r664943668



##########
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:
       ```suggestion
     /* Initialize the user heap if wasn't yet. */
   
     umm_try_initialize();
   
   ```
   
   Why is this required here?




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



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

Posted by GitBox <gi...@apache.org>.
Ouss4 commented on a change in pull request #4068:
URL: https://github.com/apache/incubator-nuttx/pull/4068#discussion_r664943668



##########
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:
       ```suggestion
     /* Initialize the user heap if wasn't yet. */
   
     umm_try_initialize();
   ```
   
   Why is this required here?




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



[GitHub] [incubator-nuttx] davids5 merged pull request #4068: mm: Remove mm_heap_impl_s struct

Posted by GitBox <gi...@apache.org>.
davids5 merged pull request #4068:
URL: https://github.com/apache/incubator-nuttx/pull/4068


   


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



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

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #4068:
URL: https://github.com/apache/incubator-nuttx/pull/4068#discussion_r665017908



##########
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:
       the comment is fixed, @Ouss4 




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



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

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on pull request #4068:
URL: https://github.com/apache/incubator-nuttx/pull/4068#issuecomment-875250396


   > @xiaoxiang781216 I just noticed that the change adding the name is not reflected in the mm/README.txt nor the titale blocks
   > 
   > ```
   > /****************************************************************************
   >  * Name: mm_initialize
   >  *
   >  * Description:
   >  *   Initialize the selected heap data structures, providing the initial
   >  *   heap region.
   >  *
   >  * Input Parameters:
   >  *   heap      - The selected heap
   >  *   heapstart - Start of the initial heap region
   >  *   heapsize  - Size of the initial heap region
   >  *
   >  * Returned Value:
   >  *   None
   >  *
   >  * Assumptions:
   >  *
   >  ****************************************************************************/
   > ```
   
   Done.


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