17 #define INLINE inline __attribute__((always_inline))
22 /* MGCHash *********************************************************/
23 typedef struct mgchashlistnode {
25 void * val; //this can be cast to another type or used to point to a
27 struct mgchashlistnode *next;
30 typedef struct mgchashtable {
31 mgchashlistnode_t *table; // points to beginning of hash table
34 unsigned int numelements;
35 unsigned int threshold;
39 #define NUMMGCLIST 250
40 typedef struct mgclist {
41 struct mgchashlistnode array[NUMMGCLIST];
46 void mgchashCreate(unsigned int size, double loadfactor);
47 void mgchashInsert(void * key, void *val);
48 void * mgchashSearch(void * key);
49 unsigned int mgchashResize(unsigned int newsize);
51 void mgchashInsert_I(void * key, void *val);
52 unsigned int mgchashResize_I(unsigned int newsize);
58 struct MGCHash * allocateMGCHash(int size, int conflicts);
59 void freeMGCHash(struct MGCHash *);
61 //void MGCHashrehash(struct MGCHash * thisvar);
62 int MGCHashadd(struct MGCHash *, int data);
64 struct MGCHash * allocateMGCHash_I(int size, int conflicts);
65 int MGCHashadd_I(struct MGCHash *, int data);
67 int MGCHashcontains(struct MGCHash *,int data);
72 struct MGCNode *bucket;
75 /* MGCHashException *************************************************/
78 struct MGCNode * next;