Skip to content

Instantly share code, notes, and snippets.

@rikaardhosein
Created July 2, 2012 01:25
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 rikaardhosein/3030372 to your computer and use it in GitHub Desktop.
Save rikaardhosein/3030372 to your computer and use it in GitHub Desktop.
if ((unsigned long)(nb) <= (unsigned long)(get_max_fast ()))
{
idx = fastbin_index(nb);
mfastbinptr* fb = &fastbin (av, idx);
mchunkptr pp = *fb;
do
{
victim = pp;
if (victim == NULL)
break;
}
while ( (pp = catomic_compare_and_exchange_val_acq (fb, victim->fd, victim)) != victim);
if (victim != 0)
{
check_remalloced_chunk(av, victim, nb);
void *p = chunk2mem(victim);
if ( perturb_byte) alloc_perturb (p, bytes);
return p;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment