for(;;){
int iters =0;while((victim =unsorted_chunks(av)->bk)!=unsorted_chunks(av)){
bck = victim->bk;
size =chunksize(victim);
mchunkptr next =chunk_at_offset(victim, size);if(__glibc_unlikely(size <=2* SIZE_SZ)||__glibc_unlikely(size > av->system_mem))malloc_printerr("malloc(): invalid size (unsorted)");if(__glibc_unlikely(chunksize_nomask(next)<2* SIZE_SZ)||__glibc_unlikely(chunksize_nomask(next)> av->system_mem))malloc_printerr("malloc(): invalid next size (unsorted)");if(__glibc_unlikely((prev_size(next)&~(SIZE_BITS))!= size))malloc_printerr("malloc(): mismatching next->prev_size (unsorted)");if(__glibc_unlikely(bck->fd != victim)||__glibc_unlikely(victim->fd !=unsorted_chunks(av)))malloc_printerr("malloc(): unsorted double linked list corrupted");if(__glibc_unlikely(prev_inuse(next)))malloc_printerr("malloc(): invalid next->prev_inuse (unsorted)");/*
If a small request, try to use last remainder if it is the
only chunk in unsorted bin. This helps promote locality for
runs of consecutive small requests. This is the only
exception to best-fit, and applies only when there is
no exact fit for a small chunk.
*/if(in_smallbin_range(nb)&&
bck ==unsorted_chunks(av)&&
victim == av->last_remainder &&(unsignedlong)(size)>(unsignedlong)(nb + MINSIZE)){
/* split and reattach remainder */
remainder_size = size - nb;
remainder =chunk_at_offset(victim, nb);unsorted_chunks(av)->bk =unsorted_chunks(av)->fd = remainder;
av->last_remainder = remainder;
remainder->bk = remainder->fd =unsorted_chunks(av);if(!in_smallbin_range(remainder_size)){
remainder->fd_nextsize =NULL;
remainder->bk_nextsize =NULL;}set_head(victim, nb | PREV_INUSE |(av !=&main_arena ? NON_MAIN_ARENA :0));set_head(remainder, remainder_size | PREV_INUSE);set_foot(remainder, remainder_size);check_malloced_chunk(av, victim, nb);void*p =chunk2mem(victim);alloc_perturb(p, bytes);return p;}/* remove from unsorted list */if(__glibc_unlikely(bck->fd != victim))malloc_printerr("malloc(): corrupted unsorted chunks 3");unsorted_chunks(av)->bk = bck;
bck->fd =unsorted_chunks(av);/* Take now instead of binning if exact fit */if(size == nb){
set_inuse_bit_at_offset(victim, size);if(av !=&main_arena)set_non_main_arena(victim);#ifUSE_TCACHE/* Fill cache first, return to user only if cache fills.
We may return one of these chunks later. */if(tcache_nb
&& tcache-></