pike.git / src / hashtable.c

version» Context lines:

pike.git/src/hashtable.c:76:      /*    * rehash - ugh    */   struct hash_table *hash_rehash(struct hash_table *h,int size)   {    struct hash_table *new;    int e;      #ifdef PIKE_DEBUG -  if( 1 << my_log2(size) != size) -  Pike_fatal("Size is not a power of two!\n"); +  if (size & (size-1)) +  Pike_fatal("Size is not a power of two! Size: 0x%08x\n", size);   #endif       new=(struct hash_table *)calloc(1,sizeof(struct hash_table)+    (size-1)*sizeof(struct hash_entry *));    new->mask = size - 1;    new->entries = h->entries;       for(e=0; e<=h->mask; e++)    rehash_list_backwards(new,h->htable[e]);