pike.git / src / block_allocator.c

version» Context lines:

pike.git/src/block_allocator.c:528:    p->h.used ++;       free_list = p->h.first;    free_block = free_list;       it.cur = BA_BLOCKN(it.l, p, 0);       while(1) {    if (free_block == NULL) {    it.end = ((char*)BA_LASTBLOCK(it.l, p) + it.l.block_size); + #ifdef PIKE_DEBUG +  if ((char*)it.end < (char*)it.cur) +  Pike_fatal("Free list not sorted in ba_walk.\n"); + #endif    if ((char*)it.end != (char*)it.cur) {    cb(&it, data);    }    break;    } else if (free_block == BA_ONE) {    /* all consecutive blocks are free, so we are dont */    break;    }       it.end = free_block; -  +  free_block = free_block->next; +    #ifdef PIKE_DEBUG -  if (free_block >= free_block->next) +  if ((char*)it.end < (char*)it.cur)    Pike_fatal("Free list not sorted in ba_walk.\n");   #endif -  free_block = free_block->next; -  +     if ((char*)it.end != (char*)it.cur)    cb(&it, data);       it.cur = (char*)it.end + it.l.block_size;    }       /* if the callback throws, this will never happen */    ba_list_undefined(a, free_list);    p->h.used--;    }    ba_double_layout(&it.l);    }       /* during the iteration blocks might have been freed. The pages will still be there, so we might have    * to do some cleanup. */    if (!a->pages[a->size-1]->h.used)    ba_free_empty_pages(a);   }