Branch: Tag:

2014-12-04

2014-12-04 19:24:33 by Arne Goedeke <el@laramies.com>

string hashing: do not change to siphash right away

76:   static unsigned int hash_prefix_len=64;   static unsigned int need_more_hash_prefix_depth=0;    - /* Force a new hashkey to be generated early during init. */ - static unsigned int need_new_hashkey_depth=0xffff; + static unsigned int need_new_hashkey_depth=0;   static size_t hashkey = 0;      static unsigned INT32 htable_size=0;
748:    * /Hubbe    */    +  if (need_new_hashkey_depth > 128) { +  /* A simple mixing function. */ +  hashkey ^= (hashkey << 5) ^ (current_time.tv_sec ^ current_time.tv_usec); +  need_new_hashkey_depth = 0; +  } +    #ifdef PIKE_RUN_UNLOCKED    mt_lock(bucket_locks);    if(need_more_hash_prefix_depth <= 4)
759:    for(h=1;h<BUCKET_LOCKS;h++) mt_lock(bucket_locks+h);   #endif    -  /* A simple mixing function. */ -  hashkey ^= (hashkey << 5) ^ (current_time.tv_sec ^ current_time.tv_usec); -  +     if (need_more_hash_prefix_depth > 4)    {    hash_prefix_len=hash_prefix_len*2;
773:    /* NOTE: No need to update to the correct values, since that will    * be done on demand.    */ -  need_new_hashkey_depth = 0; +     need_more_hash_prefix_depth=0;       for(h=0;h<htable_size;h++)