pike.git / src / block_allocator.c

version» Context lines:

pike.git/src/block_allocator.c:135: Inside #if defined(BA_STATS)
   printf(fmt,    a->st_name,    used / 1024.0, malloced / 1024.0,    a->st_max_pages, overhead / 1024.0,    mall / 1024.0,    moverhead / 1024.0,    all / 1024.0,    a->block_size * a->blocks,    a->block_size    ); +  if (a->good || a->bad || a->ugly || a->likely || a->max) { +  printf("COUNTS:\n%lu good\t %lu bad\t %lu ugly\t %lu likely\t %lu max %lu full %lu empty\n", a->good, a->bad, a->ugly, a->likely, a->max, +  a->full, a->empty);    } -  + }   #endif      //#define BA_ALIGNMENT 8      PMOD_EXPORT INLINE void ba_init(struct block_allocator * a,    uint32_t block_size, ba_page_t blocks) {    uint32_t page_size;      #ifdef BA_ALIGNMENT    if (block_size & (BA_ALIGNMENT - 1))
pike.git/src/block_allocator.c:430: Inside #if defined(DEBUG)
   ba_print_htable(a);    fprintf(stderr, "ba_htable_delete(%p, %u)\n", ptr, n);    BA_ERROR("did not find index to delete.\n")   #endif   }      static INLINE ba_page_t ba_htable_lookup(const struct block_allocator * a,    const void * ptr) {    ba_page p;    ba_page_t n1, n2; - #ifdef COUNT -  count_name = "hash"; - #endif +     n1 = a->htable[hash1(a, ptr) & BA_HASH_MASK(a)];    n2 = a->htable[hash2(a, ptr) & BA_HASH_MASK(a)];       while (n1 || n2) {    if (n1) {    p = BA_PAGE(a, n1);    if (BA_CHECK_PTR(a, p, ptr)) {    return n1;    }    n1 = p->hchain;