Skip to content

Instantly share code, notes, and snippets.

@vanhoefm
Last active December 12, 2015 02:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vanhoefm/4703872 to your computer and use it in GitHub Desktop.
Save vanhoefm/4703872 to your computer and use it in GitHub Desktop.
/* Take a chunk off a bin list */
void unlink(malloc_chunk *P, malloc_chunk *BK, malloc_chunk *FD)
{
FD = P->fd;
BK = P->bk;
if (__builtin_expect (FD->bk != P || BK->fd != P, 0))
malloc_printerr(check_action,"corrupted double-linked list",P);
else {
FD->bk = BK;
BK->fd = FD;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment