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


##########
mm/umm_heap/umm_realloc.c:
##########
@@ -83,7 +77,7 @@ FAR void *realloc(FAR void *oldmem, size_t size)
       mem = mm_realloc(USR_HEAP, oldmem, size);
       if (!mem)
         {
-          brkaddr = sbrk(size);
+          brkaddr = sbrk(size < 1 ? 1 : size);

Review Comment:
   > Same answer as above. `MM_MIN_CHUNK` is not valid for `tlsf_realloc`
   
   But there still could be an issue here.  Not just for size < 1 for for all 
sizes.  The sizes don't include quantization overhead, or the overhead from the 
memory header.  So the amount of memory requested is smaller than that which is 
actually needed.  If nothing else, that does leave me a little uneasy.
   
   If tlsf_realloc and mm_realloc are different, that would not change the 
issue, that would just make any solution that might be needed more difficult 
(and I'm not even certain that one is needed).  I'll open an issue so we don't 
forget, but let's decouple this from the change at hand in the interest of 
making progress.
   
   Issue #9155



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