Show
Ignore:
Timestamp:
09/08/11 14:37:55 (3 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1315492675 -0400
git-parent:

[4ace564f33d37b3d293284f7261dfd478027df90]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1315492675 -0400
Message:

support creating hashes with larger initial sizes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/utils/noit_hash.c

    r48a51fb r3f777ae  
    107107} 
    108108 
     109void noit_hash_init_size(noit_hash_table *h, int size) { 
     110  memset(h, 0, sizeof(noit_hash_table)); 
     111  h->initval = lrand48(); 
     112  h->table_size = size; 
     113  h->buckets = calloc(h->table_size, sizeof(noit_hash_bucket *)); 
     114} 
     115 
    109116noit_hash_bucket *noit_hash__new_bucket(const char *k, int klen, void *data) { 
    110117  noit_hash_bucket *b; 
  • src/utils/noit_hash.h

    r6210da7 r3f777ae  
    6767 
    6868void noit_hash_init(noit_hash_table *h); 
     69void noit_hash_init_size(noit_hash_table *h, int size); 
    6970/* NOTE! "k" and "data" MUST NOT be transient buffers, as the hash table 
    7071 * implementation does not duplicate them.  You provide a pair of