20 /* GCSharedHash *********************************************************/
22 struct GCSharedHash * noargallocateGCSharedHash();
23 struct GCSharedHash * allocateGCSharedHash(int size);
24 void freeGCSharedHash(struct GCSharedHash *);
26 bool GCSharedHashrehash(struct GCSharedHash * thisvar);
27 int GCSharedHashadd(struct GCSharedHash *, int key, int data);
29 struct GCSharedHash * allocateGCSharedHash_I(int size);
30 int GCSharedHashadd_I(struct GCSharedHash *, int key, int data);
32 int GCSharedHashget(struct GCSharedHash *,int key, int* data);
37 struct GCSharedNode **bucket;
38 struct GCSharedNode *listhead;
39 struct GCSharedNode *listtail;
42 inline int GCSharedHashcountset(struct GCSharedHash * thisvar);
44 /* RuntimeHashException *************************************************/
47 /* RuntimeIterator *****************************************************/
49 struct GCSharedNode *next;
50 struct GCSharedNode *lnext;
51 struct GCSharedNode *lprev;
56 /* MGCSharedHash *********************************************************/
57 typedef struct mgcsharedhashlistnode {
59 void * val; //this can be cast to another type or used to point to a
61 struct mgcsharedhashlistnode * next;
62 } mgcsharedhashlistnode_t;
64 #define NUMMGCSHAREDLIST 250
65 typedef struct mgcsharedlist {
66 struct mgcsharedhashlistnode array[NUMMGCSHAREDLIST];
68 struct mgcsharedlist *next;
69 } mgcsharedliststruct_t;
71 typedef struct mgcsharedhashtbl {
72 mgcsharedhashlistnode_t * table; // points to beginning of hash table
73 mgcsharedhashlistnode_t * list;
74 mgcsharedliststruct_t * structs;
77 unsigned int numelements;
78 unsigned int threshold;
82 mgcsharedhashtbl_t * mgcsharedhashCreate(unsigned int size, double loadfactor);
83 mgcsharedhashtbl_t * mgcsharedhashCreate_I(unsigned int size,double loadfactor);
84 int mgcsharedhashInsert(mgcsharedhashtbl_t * tbl, void * key, void * val);
85 void * mgcsharedhashSearch(mgcsharedhashtbl_t * tbl, void * key);
86 int mgcsharedhashInsert_I(mgcsharedhashtbl_t * tbl, void * key, void * val);
87 void mgcsharedhashReset(mgcsharedhashtbl_t * tbl);