WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
irmalloc.h
浏览该文件的文档.
1/*
2 * Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2018-2020. All rights reserved.
3 * Description: malloc function
4 * Author:
5 * Create:
6 */
7
8#ifndef IRMALLOC_H
9#define IRMALLOC_H
10
11#include "std_def.h"
12
18// for IAR compiler
19#ifdef __cplusplus
20extern "C" {
21#endif
22
25
31void irmalloc_new_pool(unsigned char *start, size_t size);
32
38//lint -function(malloc,irmalloc) irmalloc has the same semantics as malloc.
39void *irmalloc(size_t size);
40
41
42void *irmemalign(size_t boundary, size_t size);
43
49//lint -function(malloc(0),irmalloc_panicking) irmalloc has the same semantics as malloc, but doesn't return NULL.
50//lint -function(malloc(1),irmalloc_panicking) irmalloc has the same semantics as malloc, but doesn't return NULL.
51void *irmalloc_panicking(size_t size);
52
58//lint -function(malloc,irzalloc) irzalloc has the same semantics as malloc.
59void *irzalloc(size_t size);
60
67#define ircalloc(size, number) irzalloc((size) * (number))
68
73//lint -function(free,irfree) irfree has the same semantics as free.
74void irfree(void *buf);
75
82void *irmalloc_dup(const void *orig, size_t size);
83
87//lint -function(realloc,irrealloc) irrealloc has the same semantics as realloc.
88void *irrealloc(void *buf, size_t size);
89
91// irrealloc_panicking has the same semantics as realloc, but doesn't return NULL.
92void *irrealloc_panicking(void *buf, size_t size);
93
101
110void irmalloc_get_machine_readable_stats(uint32_t *current_allocated, uint32_t *total_free,
111 uint32_t *max_free, uint32_t *num_allocs, uint32_t *num_frees);
112
113#ifdef __cplusplus
114}
115#endif
119#endif
void irmalloc_get_machine_readable_stats(uint32_t *current_allocated, uint32_t *total_free, uint32_t *max_free, uint32_t *num_allocs, uint32_t *num_frees)
Get some macine readable statistics on the memory management state
void irfree(void *buf)
Free a block of memory
void irmalloc_init_default(void)
void * irmalloc(size_t size)
Allocate a block of memory from internal RAM
void * irmalloc_dup(const void *orig, size_t size)
Duplicate the contents of a block of memory into irmalloc.
char * irmalloc_get_human_readable_stats(void)
Get some human readable statistics on the memory management state
void * irmemalign(size_t boundary, size_t size)
void * irrealloc(void *buf, size_t size)
Reallocate a block of memory
void * irrealloc_panicking(void *buf, size_t size)
void irmalloc_new_pool(unsigned char *start, size_t size)
Add an additional memory pool to allocate from; the irmalloc implementation is not obliged to use thi...
void * irmalloc_panicking(size_t size)
Allocate a block of memory from internal RAM or panic on failure
void * irzalloc(size_t size)
Allocate a block of memory and zero it.