XFusion API
v1.3.0
载入中...
搜索中...
未找到
examples/system/heap/main/xf_main.c
动态内存示例。
1
17
/* ==================== [Includes] ========================================== */
18
19
#include "xf_utils.h"
20
21
/* ==================== [Defines] =========================================== */
22
23
#define TAG "example_heap"
24
25
/* ==================== [Typedefs] ========================================== */
26
27
/* ==================== [Static Prototypes] ================================= */
28
29
/* ==================== [Static Variables] ================================== */
30
31
/* ==================== [Macros] ============================================ */
32
33
/* ==================== [Global Functions] ================================== */
34
35
void
xf_main
(
void
)
36
{
37
size_t
size =
xf_heap_get_free_size
();
38
XF_LOGI
(
TAG
,
"free size:%d"
, size);
39
40
int
*value = (
int
*)
xf_malloc
(
sizeof
(
int
));
41
*value = 11;
42
XF_LOGI
(
TAG
,
"value:%d"
, *value);
43
44
size =
xf_heap_get_free_size
();
45
XF_LOGI
(
TAG
,
"free size:%d"
, size);
46
47
xf_free
(value);
48
49
size =
xf_heap_get_free_size
();
50
XF_LOGI
(
TAG
,
"free size:%d"
, size);
51
}
52
53
/* ==================== [Static Functions] ================================== */
xf_main
void xf_main(void)
Definition
xf_main.c:28
xf_heap_get_free_size
unsigned int xf_heap_get_free_size(void)
获取内存总空闲大小。
Definition
xf_heap.c:125
xf_malloc
#define xf_malloc(x)
Definition
xf_stdlib.h:38
xf_free
#define xf_free(x)
Definition
xf_stdlib.h:39
TAG
#define TAG
Definition
xf_main.c:24
XF_LOGI
#define XF_LOGI(tag, format,...)
Definition
xf_log_uitls.h:44
生成于 2025年 一月 21日 星期二 17:25:08 , 为 XFusion API使用
1.9.8