⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cetc_heap_test.c

📁 linux 数据结构堆栈操作。。 。。 。。 。
💻 C
字号:
#include <stdio.h>#include <string.h>#include <stdlib.h>#include <unistd.h>#include "cetc_heap.h"typedef struct _tagMsg tagMsg;struct _tagMsg{	int owner;	int msgid;	int wparam;	int lparam;};int main(){ 	tagPrivHeap heap;	tagMsg *msg;	int i;	cetc_init_privheap(&heap, 64, sizeof(tagMsg));	for(i=0; i<64; i++)	{		msg =(tagMsg *)cetc_alloc_from_privheap(&heap);		printf("msg addr=%p\n", msg);	}	msg =(tagMsg *)cetc_alloc_from_privheap(&heap);	printf("msg addr=%p\n", msg);	cetc_free_to_privheap(&heap, msg);	cetc_destroy_privheap(&heap);	return 0;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -