pike.git / src / block_allocator.c

version» Context lines:

pike.git/src/block_allocator.c:300: Inside #if defined(DEBUG)
   }   #ifdef DEBUG    ba_print_htable(a);    fprintf(stderr, "ba_htable_delete(%p, %u)\n", ptr, n);    Pike_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) { + #ifdef COUNT +  count_name = "hash"; + #endif   #ifdef BA_DEBUG    int c = 0;   #endif    ba_page_t n;    ba_page p;    n = a->htable[hash1(a, ptr) & BA_HASH_MASK(a)];    while (n) {    p = BA_PAGE(a, n);    if (BA_CHECK_PTR(a, p, ptr)) { -  +  INC(good);    return n;    }    n = p->hchain;    }    n = a->htable[hash2(a, ptr) & BA_HASH_MASK(a)];    while (n) {    p = BA_PAGE(a, n);    if (BA_CHECK_PTR(a, p, ptr)) { -  +  if (a->htable[hash1(a, ptr) & BA_HASH_MASK(a)]) +  INC(ugly); +  else INC(bad);    return n;    }   #ifdef BA_DEBUG    if (c++ > a->allocated) {    Pike_error("hash chain is infinite\n");    }   #endif    n = p->hchain;    }