This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new e04853536d mm: fix tlsf compiler error
e04853536d is described below

commit e04853536d9a8d6a583fee1d267a60780e02c48d
Author: yinshengkai <[email protected]>
AuthorDate: Sun Apr 28 21:09:20 2024 +0800

    mm: fix tlsf compiler error
    
    error: ‘nodesize’ undeclared (first use in this function)
      518 |       memset(mem, MM_FREE_MAGIC, nodesize);
    tlsf/mm_tlsf.c:1288:10: warning: unused variable ‘newsize’ 
[-Wunused-variable]
     1288 |   size_t newsize;
    
    Signed-off-by: yinshengkai <[email protected]>
---
 mm/tlsf/mm_tlsf.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/mm/tlsf/mm_tlsf.c b/mm/tlsf/mm_tlsf.c
index eb96625429..2774dc8c7f 100644
--- a/mm/tlsf/mm_tlsf.c
+++ b/mm/tlsf/mm_tlsf.c
@@ -605,7 +605,7 @@ static void mm_delayfree(FAR struct mm_heap_s *heap, FAR 
void *mem,
   if (delay)
 #endif
     {
-      memset(mem, MM_FREE_MAGIC, nodesize);
+      memset(mem, MM_FREE_MAGIC, size);
     }
 #endif
 
@@ -1486,8 +1486,10 @@ FAR void *mm_realloc(FAR struct mm_heap_s *heap, FAR 
void *oldmem,
                      size_t size)
 {
   FAR void *newmem;
+#ifndef CONFIG_MM_KASAN
   size_t oldsize;
   size_t newsize;
+#endif
 
   /* If oldmem is NULL, then realloc is equivalent to malloc */
 

Reply via email to