XFusion API v1.3.0
|
基于 heap5 的内存分配实现。 更多...
函数 | |
void * | xf_heap_malloc (unsigned int size) |
带内存管理的内存申请函数。 | |
void | xf_heap_free (void *pv) |
带内存管理的内存释放函数。 | |
unsigned int | xf_heap_region (const xf_heap_region_t *const heap_regions) |
内存注册,需要在使用 xf_heap_malloc 之前注册。 | |
unsigned int | xf_heap_get_block_size (void *pv) |
获取内存块的实际大小。 | |
基于 heap5 的内存分配实现。
在文件 xf_alloc.h 中定义.
void * xf_heap_malloc | ( | unsigned int | size | ) |
带内存管理的内存申请函数。
size | 申请内存的大小。 |
内存剩余足够,则切割成已使用内存块和更小的空闲内存块, 空闲内存块插入空闲内存块链表
在文件 xf_alloc.c 第 60 行定义.
void xf_heap_free | ( | void * | pv | ) |
unsigned int xf_heap_region | ( | const xf_heap_region_t *const | heap_regions | ) |
内存注册,需要在使用 xf_heap_malloc 之前注册。
heap_regions | 注册内存的数据信息。 |
在文件 xf_alloc.c 第 141 行定义.
unsigned int xf_heap_get_block_size | ( | void * | pv | ) |