my-malloc.h

来自「所有的操作系统实验相当好的」· C头文件 代码 · 共 16 行

H
16
字号
# include <stdlib.h>
typedef long Align;				/* for alignment to long boundary */
union header {					/* block header: */
	struct {
		union header *next;		/* next block if on Free list */
		unsigned int size;		/* size of this block */
	} s;
	Align x;					/* force alignment of blocks */
};
typedef union header Header;

# define NALLOC 10				/* minimum #units to request */
static Header* morecore(unsigned int nu);
void* Malloc(unsigned int nbytes);
void Free(void *ap);

⌨️ 快捷键说明

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