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:
Xiang Xiao
2021-06-27 03:57:56 +08:00
committed by Alan Carvalho de Assis
parent f4a374b6d9
commit 97216c220b
4 changed files with 11 additions and 7 deletions
+1 -1
View File
@@ -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);