pike.git / src / block_allocator.c

version» Context lines:

pike.git/src/block_allocator.c:82:    size_t c = 0;    unsigned int i;    for (i = 0; i < a->size; i++) {    c += a->pages[i]->h.used;    }       return c;   }      PMOD_EXPORT void ba_count_all(const struct block_allocator * a, size_t * num, size_t * size) { +  if (a->size) {    size_t n = (a->l.blocks << (a->size-1)) - a->l.blocks;    *num = n;    *size = a->l.block_size * n; -  +  } else { +  *num = *size = 0;    } -  + }      static void ba_low_alloc(struct block_allocator * a) {    if (a->l.offset) {    unsigned int i;       for (i = 1; i <= a->size; i++) {    struct ba_page * p = a->pages[a->size - i];       if (p->h.first) {    a->alloc = a->size - i;