




























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





























































































CS351 : Saelee
void *malloc(size_t size); void *realloc(void *ptr, size_t size); void free(void *ptr); C Standard Library
basic issues:
Heap start brk logical view
heap records (blocks) must be self-describing
malloc(10) metadata payload 10 bytes pointer returned to application
block size
need to distinguish allocated vs. free blocks
allocated bit — use least significant bit of header word
malloc( 11 ) 0x0000000F (^) payload 4 bytes 11 bytes ??
require block size alignment to powers of 2
not really necessary!