1 Star 4 Fork 8

vtor3478/vtor_elec_module

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
vtor_heap.h 1.30 KB
一键复制 编辑 原始数据 按行查看 历史
#ifndef __VTOR_HEAP_H__
#define __VTOR_HEAP_H__
#ifdef __cplusplus
extern "C" {
#endif
#include "vtor_elec_module_config.h"
#ifdef __VTOR_HEAP__
typedef struct VtorHeapNodeStruct
{
struct VtorHeapNodeStruct* nextHeapNode;
int heapLen;
int heapHeadMagicNumber;
}VtorHeapNode;
#define VtorHeapHeadMagicNumber 0xcdcdcdcd
#define VtorHeap0_Init(heapBuf, heapSize) VtorHeap_Init(0, heapBuf, heapSize)
#define VtorHeap0_Malloc(userSize) VtorHeap_Malloc(0, userSize)
#define VtorHeap0_Free(heapBuf) VtorHeap_Free(0, heapBuf)
#define VtorHeap1_Init(heapBuf, heapSize) VtorHeap_Init(1, heapBuf, heapSize)
#define VtorHeap1_Malloc(userSize) VtorHeap_Malloc(1, userSize)
#define VtorHeap1_Free(heapBuf) VtorHeap_Free(1, heapBuf)
#define VtorHeap2_Init(heapBuf, heapSize) VtorHeap_Init(2, heapBuf, heapSize)
#define VtorHeap2_Malloc(userSize) VtorHeap_Malloc(2, userSize)
#define VtorHeap2_Free(heapBuf) VtorHeap_Free(2, heapBuf)
void VtorHeap_SetHeadNode(int heapIdx, void* heapBuf);
VtorHeapNode* VtorHeap_GetHeadNode(int heapIdx);
VtorHeapNode* VtorHeap_Init(int heapIdx, void* heapBuf, int heapSize);
void VtorHeap_PrintInfo(int heapIdx);
void* VtorHeap_Malloc(int heapIdx, int userSize);
void VtorHeap_Free(int heapIdx, void* heapBuf);
#endif // __VTOR_HEAP__
#ifdef __cplusplus
}
#endif
#endif
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/vtor3478/vtor_elec_module.git
git@gitee.com:vtor3478/vtor_elec_module.git
vtor3478
vtor_elec_module
vtor_elec_module
main

搜索帮助

0d507c66 1850385 C8b1a773 1850385