pike.git / src / block_allocator.c

version» Context lines:

pike.git/src/block_allocator.c:389: Inside #if defined(BA_DEBUG)
  #ifdef BA_DEBUG    if (!p->data) {    fprintf(stderr, "got null pointer from uninitialized page %d of block %d (num_pages %d).\n", a->first, p->first-1, a->num_pages);    }   #endif    //fprintf(stderr, "alloced pointer %p (%u/%u used %u)\n",    //ptr, p->first-1, a->blocks, p->blocks_used);       if (unlikely(p->blocks_used == a->blocks)) {    a->first = p->next; -  BA_PAGE(a, a->first)->prev = 0; +     if (!a->first) {    a->last = 0; -  } +  } else +  BA_PAGE(a, a->first)->prev = 0;    p->next = 0;    } else {    //fprintf(stderr, "next: %u\n", ((struct ba_block_header*)ptr)->next);    if (((struct ba_block_header*)ptr)->next)    p->first = ((struct ba_block_header*)ptr)->next;    else p->first++;    }    //fprintf(stderr, "first is %u\n", p->first);       return ptr;