15 //TODO consider changing loadfactor?
16 #define CLOADFACTOR 0.25
17 #define CHASH_SIZE 1024
19 #define INLINE inline __attribute__((always_inline))
21 typedef struct chashlistnode {
22 void * keyAndVal; //this can be cast to another type or used to point to a larger structure
23 struct chashlistnode *next;
24 struct chashlistnode *lnext;
27 typedef struct chashtable {
28 chashlistnode_t *table; // points to beginning of hash table
31 unsigned int numelements;
32 unsigned int threshold;
37 typedef struct clist {
38 struct chashlistnode array[NUMCLIST];
44 void hashRCRCreate(unsigned int size, double loadfactor);
45 void hashRCRInsert(void * addrIn);
46 void * hashRCRSearch(void * key);
47 unsigned int hashRCRResize(unsigned int newsize);
51 //TODO add __thread after extern for all of these
52 //TODO consider changing names to avoid conflicts
53 extern chashlistnode_t *c_table;
54 extern chashlistnode_t *c_list;
55 extern unsigned int c_size;
56 extern unsigned INTPTR c_mask;
57 extern unsigned int c_numelements;
58 extern unsigned int c_threshold;
59 extern double c_loadfactor;
60 extern cliststruct_t *c_structs;