内存管理

函数

void * aos_realloc (void *mem, size_t size)
 
void * aos_malloc (size_t size)
 
void * aos_calloc (size_t nitems, size_t size)
 
void * aos_zalloc (size_t size)
 
void aos_alloc_trace (void *addr, uintptr_t allocator)
 
void aos_free (void *mem)
 

详细描述

提供AliOS Things系统内核内存管理功能的基础API.

函数说明

◆ aos_alloc_trace()

void aos_alloc_trace ( void *  addr,
uintptr_t  allocator 
)

Trace alloced mems.

参数
[in]addrpointer of the mem alloced by malloc.
[in]allocatorbuildin_address.

◆ aos_calloc()

void* aos_calloc ( size_t  nitems,
size_t  size 
)

Alloc memory and clear to zero.

参数
[in]nitemsnumber of items to malloc.
[in]sizesize of one item to malloc.
返回
NULL: error.

◆ aos_free()

void aos_free ( void *  mem)

Free memory.

参数
[in]ptraddress point of the mem.
返回
none.

◆ aos_malloc()

void* aos_malloc ( size_t  size)

Alloc memory.

参数
[in]sizesize of the mem to malloc.
返回
NULL: error.

◆ aos_realloc()

void* aos_realloc ( void *  mem,
size_t  size 
)

Realloc memory.

参数
[in]memcurrent memory address point.
[in]sizenew size of the mem to remalloc.
返回
NULL: error.

◆ aos_zalloc()

void* aos_zalloc ( size_t  size)

Alloc memory and clear to zero.

参数
[in]sizesize of the mem to malloc.
返回
NULL: error.