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


##########
mm/tlsf/mm_tlsf.c:
##########
@@ -1005,6 +1004,13 @@ FAR void *mm_malloc(FAR struct mm_heap_s *heap, size_t 
size)
 {
   FAR void *ret;
 
+  /* In case of zero-length allocations allocate the minimum size object */
+
+  if (size < 1)
+    {
+      size = 1;
+    }
+

Review Comment:
   `mempool_multiple_alloc` handles zero size correctly, but `tlsf_malloc` does 
not, It just return NULL, so either patch TLFS malloc code or adding this at 
wrapper level



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