patacongo commented on code in PR #9151:
URL: https://github.com/apache/nuttx/pull/9151#discussion_r1182665078
##########
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:
Passing size=0 and size=1 to mm_malloc have the same effect. A minimum chunk
size is allocated. So I think the above can be removed.
Hmm.. but I see that size is used in mempool_multiple_alloc() as well.
Maybe not?
--
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]