📄 test.c
字号:
#include "balloc.h"char buf[1024];main(){ int i = 0; char *pa, *pb, *pc; if (init_alloc_heap(1024, buf) == EOK) { print_alloc_heap(); puts("__________________________"); pa = (char *)balloc(1024); print_alloc_heap(); puts("___________________________"); bfree(pa); pb = (char *)balloc(1000); pc = (char *)balloc(100); if (!pc) { printf("no enought memory\n"); } print_alloc_heap(); puts("________________________________"); bfree(pb); print_alloc_heap(); puts("__________________________________"); pa = (char *)balloc(100); pb = (char *)balloc(500); print_alloc_heap(); puts("______________________________"); bfree(pa); print_alloc_heap(); puts("______________________________"); bfree(pb); print_alloc_heap(); puts("_________________________________"); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -