2. Implementation

ptr = malloc(20);
typedef struct { int size; int magic; } header_t;

void free(void *ptr) { header_t *hptr = (header_t *) ptr - 1; ... }