WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
IRMALLOC

宏定义

#define ircalloc(size, number)   irzalloc((size) * (number))
 Allocate a block of memory and zero it.
 

函数

void irmalloc_init_default (void)
 
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 this memory
 
void * irmalloc (size_t size)
 Allocate a block of memory from internal RAM
 
void * irmemalign (size_t boundary, size_t size)
 
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.
 
void irfree (void *buf)
 Free a block of memory
 
void * irmalloc_dup (const void *orig, size_t size)
 Duplicate the contents of a block of memory into irmalloc.
 
void * irrealloc (void *buf, size_t size)
 Reallocate a block of memory
 
void * irrealloc_panicking (void *buf, size_t size)
 
char * irmalloc_get_human_readable_stats (void)
 Get some human readable statistics on the memory management state
 
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
 

详细描述

宏定义说明

◆ ircalloc

#define ircalloc (   size,
  number 
)    irzalloc((size) * (number))

Allocate a block of memory and zero it.

参数
sizesize of each block to allocate
numbernumber of blocks to allocate
返回
pointer to allocated memory, or NULL

函数说明

◆ irfree()

void irfree ( void *  buf)

Free a block of memory

参数
buf

◆ irmalloc()

void * irmalloc ( size_t  size)

Allocate a block of memory from internal RAM

参数
sizesize of the block to allocate
返回
pointer to allocated memory, or NULL

◆ irmalloc_dup()

void * irmalloc_dup ( const void *  orig,
size_t  size 
)

Duplicate the contents of a block of memory into irmalloc.

参数
origpointer to memory to duplicate
sizesize of the block to duplicate
返回
pointer to block contain

◆ irmalloc_get_human_readable_stats()

char * irmalloc_get_human_readable_stats ( void  )

Get some human readable statistics on the memory management state

返回
the irmalloc'ed memory buffer containing a NULL terminated ASCII string of the human readbale stats; this memory must be irfree'd by the calling code note The stats format is variable and is not guaranteed to be parsable.NULL is returned if no memory is irmallocable

◆ irmalloc_get_machine_readable_stats()

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

参数
current_allocatedpointer to memory to hold current allocated size
total_freepointer to memory to hold current free pool size
max_freepointer to memory to hold maximum free block size
num_allocspointer to memory to hold accumulated number of mallocs
num_freespointer to memory to hold accumulated number of frees

◆ irmalloc_init_default()

void irmalloc_init_default ( void  )

Initialise the internal memory with the default pool passed in via the linker

◆ irmalloc_new_pool()

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 this memory

参数
startis the start memory address of the new pool
sizeis number of bytes in the new memory pool

◆ irmalloc_panicking()

void * irmalloc_panicking ( size_t  size)

Allocate a block of memory from internal RAM or panic on failure

参数
sizesize of the block to allocate
返回
pointer to allocated memory

◆ irmemalign()

void * irmemalign ( size_t  boundary,
size_t  size 
)

◆ irrealloc()

void * irrealloc ( void *  buf,
size_t  size 
)

Reallocate a block of memory

◆ irrealloc_panicking()

void * irrealloc_panicking ( void *  buf,
size_t  size 
)

Reallocate a block of memory or panic on failure

◆ irzalloc()

void * irzalloc ( size_t  size)

Allocate a block of memory and zero it.

参数
sizesize of the block to allocate
返回
pointer to allocated memory, or NULL