patacongo commented on code in PR #9151:
URL: https://github.com/apache/nuttx/pull/9151#discussion_r1182697381


##########
mm/umm_heap/umm_memalign.c:
##########
@@ -75,7 +75,7 @@ FAR void *memalign(size_t alignment, size_t size)
       mem = mm_memalign(USR_HEAP, alignment, size);
       if (!mem)
         {
-          brkaddr = sbrk(size);
+          brkaddr = sbrk(size < 1 ? 1 : size);

Review Comment:
   Could this sbrk fail?  Couldn't there be a byte free so nothing is done, but 
in reality a the whole minimum chunk size is needed.  In that case, the malloc 
would still fail because a new page was not added to the heap?  I don't know if 
that is possible but it seems wrong to requiest only one byte when you really 
need 16.



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

Reply via email to