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/10 05:47:12 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #762: mm/mm_heap: fix mm_heap not support BUILD_FLAT

xiaoxiang781216 commented on a change in pull request #762: mm/mm_heap: fix mm_heap not support BUILD_FLAT
URL: https://github.com/apache/incubator-nuttx/pull/762#discussion_r406612501
 
 

 ##########
 File path: mm/mm_heap/mm_free.c
 ##########
 @@ -105,11 +107,11 @@ void mm_free(FAR struct mm_heap_s *heap, FAR void *mem)
       mm_add_delaylist(heap, mem);
       return;
     }
-  else if (mm_trysemaphore(heap) == 0)
+  else if ((ret = mm_trysemaphore(heap)) == 0)
     {
       /* Got the sem, do free immediately */
     }
-  else if (sched_idletask())
+  else if (ret == -ESRCH || sched_idletask())
     {
       /* We are in IDLE task & can't get sem, add to mm_delaylist */
 
 Review comment:
   Add some comment about ret == -ESRCH case?

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


With regards,
Apache Git Services