|
WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
|
#include <stddef.h>#include "securec.h"#include "debug_print.h"#include "errcode.h"#include "malloc.h"
结构体 | |
| struct | malloc_state |
宏定义 | |
| #define | ALIGN4 0x4 |
| #define | DOUBLE 2 |
类型定义 | |
| typedef enum malloc_type | malloc_type_t |
| typedef uint16_t | malloc_type_t_uint16 |
| typedef struct malloc_state | malloc_state_t |
枚举 | |
| enum | malloc_type { EXT_NOTMALLOC = 0x7074 , EXT_HAVEMALLOC = 0x6C6C } |
函数 | |
| uint32_t | malloc_register_funcs (const malloc_funcs *funcs) |
| malloc_funcs * | malloc_get_funcs (void) |
| void | malloc_init (uintptr_t heap_start_addr, uintptr_t heap_end_addr) |
| 动态内存管理模块初始化接口,需要调用uapi_register_malloc接口先注册后才能使用。 | |
| void * | malloc (size_t size) |
| 申请动态内存,需要调用uapi_register_malloc接口先注册后才能使用。 | |
| void | free (void *addr) |
| 释放动态内存,需要调用uapi_register_malloc接口先注册后才能使用。 | |
| void | rom_malloc_init (uint32_t heap_start_addr, uint32_t heap_end_addr) |
| void * | rom_malloc (uint32_t size, uint32_t caller) |
| uint32_t | rom_free (void *addr) |
| void | print_mem_info (void) |
变量 | |
| malloc_dfx_t | g_st_dfx = { 0 } |
| malloc_funcs | g_malloc_func = { 0 } |
| #define ALIGN4 0x4 |
| #define DOUBLE 2 |
| typedef struct malloc_state malloc_state_t |
| typedef enum malloc_type malloc_type_t |
| typedef uint16_t malloc_type_t_uint16 |
| enum malloc_type |
| void free | ( | void * | addr | ) |
释放动态内存,需要调用uapi_register_malloc接口先注册后才能使用。
| addr | [IN] 类型 #void* 需要释放的内存地址指针。注意不要多次释放同一个内存地址。 |
| EXT_ERR_SUCCESS | 释放内存成功。 |
| EXT_ERR_FAILURE | 释放内存错误。 |
| void * malloc | ( | size_t | size | ) |
申请动态内存,需要调用uapi_register_malloc接口先注册后才能使用。
| size | [IN] 类型 #uint32_t 需要申请的内存大小 |
| void* | 申请到的内存指针,如果申请失败则返回HI_NULL |
| malloc_funcs * malloc_get_funcs | ( | void | ) |
| uint32_t malloc_register_funcs | ( | const malloc_funcs * | funcs | ) |
| void print_mem_info | ( | void | ) |
| uint32_t rom_free | ( | void * | addr | ) |
| void * rom_malloc | ( | uint32_t | size, |
| uint32_t | caller | ||
| ) |
| void rom_malloc_init | ( | uint32_t | heap_start_addr, |
| uint32_t | heap_end_addr | ||
| ) |
| malloc_funcs g_malloc_func = { 0 } |
| malloc_dfx_t g_st_dfx = { 0 } |
Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2023-2023. All rights reserved.
Description: Malloc function.
History:
2023-2-14, Create file.