pike.git / src / hashtable.c

version» Context lines:

pike.git/src/hashtable.c:59:    n->next = *base;    *base=n;   }      /*    * create a new, empty hashable   */   struct hash_table *create_hash_table(void)   {    struct hash_table *new; -  new=(struct hash_table *)calloc(1,sizeof(struct hash_table)+ +  new=calloc(1, sizeof(struct hash_table)+    (NEW_HASHTABLE_SIZE-1)*sizeof(struct hash_entry *));    new->entries=0;    new->mask=NEW_HASHTABLE_SIZE-1;    return new;   }      /*    * rehash - ugh    */   struct hash_table *hash_rehash(struct hash_table *h,int size)   {    struct hash_table *new;    int e;      #ifdef PIKE_DEBUG    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)+ +  new=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]);       free(h);    return new;   }