_malloc.h

来自「自己从头开始开发操作系统的几个实例」· C头文件 代码 · 共 29 行

H
29
字号
#ifndef __TL__MALLOC_H
#define	__TL__MALLOC_H

#ifdef __cplusplus
extern "C"
{
#endif

#include <_size_t.h>
#include <_null.h>

#define	MALLOC_MAGIC	0x6D92	/* must be < 0x8000 */

typedef struct _malloc		/* Turbo C	DJGPP */
{
	size_t size;		/* 2 bytes	 4 bytes */
	struct _malloc *next;	/* 2 bytes	 4 bytes */
	unsigned magic : 15;	/* 2 bytes total 4 bytes total */
	unsigned used : 1;
} malloc_t;		/* total   6 bytes	12 bytes */

extern malloc_t *_heap_bot, *_heap_top;

#ifdef __cplusplus
}
#endif

#endif

⌨️ 快捷键说明

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