10 #define LOADFACTOR 0.5
13 #define INLINE inline __attribute__((always_inline))
15 typedef struct lhashlistnode {
18 struct lhashlistnode *next;
21 typedef struct lhashtable {
22 lhashlistnode_t *table; // points to beginning of hash table
24 unsigned int numelements;
26 pthread_mutex_t locktable;
29 //returns 0 for success and 1 for failure
30 unsigned int lhashCreate(unsigned int size, float loadfactor);
31 //returns 0 for success and 1 for failure
32 unsigned int lhashInsert(unsigned int oid, unsigned int mid);
33 //returns mid, 0 if not found
34 unsigned int lhashSearch(unsigned int oid);
35 //returns 0 for success and 1 for failure
36 unsigned int lhashRemove(unsigned int oid);
39 unsigned int lhashResize(unsigned int newsize);
40 unsigned int lhashFunction(unsigned int oid);