mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
mm: Support malloc_size function
and rename malloc_usable_size to malloc_size Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
committed by
Alan Carvalho de Assis
parent
f4a374b6d9
commit
97216c220b
@@ -3674,7 +3674,7 @@ static void *esp_realloc_internal(void *ptr, size_t size)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
old_size = malloc_usable_size(old_ptr);
|
||||
old_size = malloc_size(old_ptr);
|
||||
DEBUGASSERT(old_size > 0);
|
||||
memcpy(new_ptr, old_ptr, MIN(old_size, size));
|
||||
kmm_free(old_ptr);
|
||||
|
||||
Reference in New Issue
Block a user