XFusion API v1.3.0
载入中...
搜索中...
未找到
xf_heap

xf_heap 堆内存接口。 更多...

函数

void * xf_malloc (unsigned int size)
 申请内存。
 
void xf_free (void *pv)
 释放内存。
 
unsigned int xf_heap_get_free_size (void)
 获取内存总空闲大小。
 
unsigned int xf_heap_get_min_ever_free_size (void)
 获取曾经最小的空闲内存块。
 

详细描述

xf_heap 堆内存接口。

如 xf_malloc, xf_free 等。 通常直接使用即可,需要时可通过 xf_heap_redirect() 函数重定向内存管理实现。 xfusion 用户使用 xf_heap 时只需 #include "xf_heap.h" 即可。

函数说明

◆ xf_malloc()

void * xf_malloc ( unsigned int  size)

申请内存。

参数
size申请内存大小。
返回
void*
  • NULL 失败
  • OTHER 成功

在文件 xf_heap.c108 行定义.

◆ xf_free()

void xf_free ( void *  pv)

释放内存。

参数
pv释放内存的大小。
注解
释放内存后记得将指针指向 NULL,以防出现访问未申请的内存。

在文件 xf_heap.c117 行定义.

◆ xf_heap_get_free_size()

unsigned int xf_heap_get_free_size ( void  )

获取内存总空闲大小。

返回
unsigned int 内存总空闲大小。

在文件 xf_heap.c125 行定义.

◆ xf_heap_get_min_ever_free_size()

unsigned int xf_heap_get_min_ever_free_size ( void  )

获取曾经最小的空闲内存块。

返回
unsigned int 内存块大小。

在文件 xf_heap.c133 行定义.