malloc lab
·
CS 이론/시스템 프로그래밍
implicit 구현 매크로부터 아래처럼 작성하면 된다. #define ALIGNMENT 8 /* rounds up to the nearest multiple of ALIGNMENT */ #define ALIGN(p) (((size_t)(p) + (ALIGNMENT-1)) & ~0x7) #define WSIZE 4 #define DSIZE 8 #define CHUNKSIZE (1 (y) ? (x) : (y)) // 최대값 #define PACK(size, alloc) ((size) | (alloc)) // 헤더에 사이즈 + 할당, 연결하기 #define GET(p) (*(unsigned int *)(p)) // 값 가져오기 #define PUT(p, val) (*(unsigned int *)(p) =(i..