由买买提看人间百态

topics

全部话题 - 话题: prevp
(共0页)
d*******u
发帖数: 186
1
来自主题: JobHunting版 - how to implement malloc?
From c programming language:
typedef long Align; /* for alignment to long boundary */
union header { /* block header */
struct {
union header *ptr; /* next block if on free list */
unsigned size; /* size of this block */
} s;
//The Align field is never used; it just forces each header to be
aligned on a worst-case boundary.
Align x; /* force alignment of blocks */
};
typedef union header Header;
static Header base; /* empty list to get started */
static Header *fr... 阅读全帖
(共0页)