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


##########
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:
   ```
   TLSF_API void* tlsf_realloc(tlsf_t tlsf, void* ptr, size_t size)
   {
        control_t* control = tlsf_cast(control_t*, tlsf);
        void* p = 0;
   
        /* Zero-size requests are treated as free. */
        if (ptr && size == 0)
        {
                tlsf_free(tlsf, ptr);
        }
   ```
   so `tlsf_realloc` is not compliant with the latest POSIX spec



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