Skip to content

Instantly share code, notes, and snippets.

@vanhoefm
Created January 8, 2013 18:26
Show Gist options
  • Save vanhoefm/4486489 to your computer and use it in GitHub Desktop.
Save vanhoefm/4486489 to your computer and use it in GitHub Desktop.
Chunk representations
struct malloc_chunk {
INTERNAL_SIZE_T prev_size; /* Size of previous chunk (if free). */
INTERNAL_SIZE_T size; /* Size in bytes, including overhead. */
struct malloc_chunk* fd; /* double links -- used only if free. */
struct malloc_chunk* bk;
/* Only used for large blocks: pointer to next larger size. */
struct malloc_chunk* fd_nextsize; /* double links -- used only if free. */
struct malloc_chunk* bk_nextsize;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment