my_malloc.h

来自「操作系统辅导与提高光盘源码」· C头文件 代码 · 共 20 行

H
20
字号
#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 + -
显示快捷键?