assoc.c
/* grows the hashtable to the next power of 2. */
grows the hashtable to the next power of 2.
grows the hashtable to the next power of 2 .
static void assoc_expand(void) {
    old_hashtable = primary_hashtable;
    primary_hashtable = calloc(hashsize(hashpower + 1), sizeof(void *));
    if (primary_hashtable) {
        if (settings.verbose > 1)
            fprintf(stderr, "Hash table expansion starting\n");
        hashpower++;
        expanding = true;
        expand_bucket = 0;
        STATS_LOCK();
        stats.hash_power_level = hashpower;
        stats.hash_bytes += hashsize(hashpower) * sizeof(void *);
        stats.hash_is_expanding = 1;
        STATS_UNLOCK();
        pthread_cond_signal(&maintenance_cond);
    } else {
        primary_hashtable = old_hashtable;
    }
}
static void assoc_expand ( void ) { old_hashtable = primary_hashtable ; primary_hashtable = calloc ( hashsize ( hashpower + 1 ) , sizeof ( void * ) ) ; if ( primary_hashtable ) { if ( settings . verbose > 1 ) fprintf ( stderr , " \n " ) ; hashpower ++ ; expanding = true ; expand_bucket = 0 ; STATS_LOCK ( ) ; stats . hash_power_level = hashpower ; stats . hash_bytes += hashsize ( hashpower ) * sizeof ( void * ) ; stats . hash_is_expanding = 1 ; STATS_UNLOCK ( ) ; pthread_cond_signal ( & maintenance_cond ) ; } else { primary_hashtable = old_hashtable ; } }
grows the hashtable to the next power of 2.
grows the hashtable to the next power of 2 .
/* Bad news, but we can keep running. */