+mgchashtable_t * mgchashCreate_I(unsigned int size, double loadfactor) {
+ mgchashtable_t *ctable;
+ mgchashlistnode_t *nodes;
+ int i;
+
+ if (size <= 0) {
+#ifdef MULTICORE
+ BAMBOO_EXIT(0xf101);
+#else
+ printf("Negative Hashtable size Exception\n");
+ exit(-1);
+#endif
+ }
+
+ // Allocate space for the hash table
+ ctable = (mgchashtable_t*)RUNMALLOC_I(sizeof(mgchashtable_t));
+ if(ctable == NULL) {
+ // Run out of local memory
+ BAMBOO_EXIT(0xf102);
+ }
+ ctable->table=(mgchashlistnode_t*)RUNMALLOC_I(size*sizeof(mgchashlistnode_t));
+ if(ctable->table == NULL) {
+ // Run out of local memory
+ BAMBOO_EXIT(0xf103);
+ }
+ ctable->loadfactor = loadfactor;
+ ctable->size = size;
+ ctable->threshold=size*loadfactor;
+
+ ctable->mask = (size << 6)-1;
+ ctable->list = NULL;
+ ctable->structs = (mgcliststruct_t*)RUNMALLOC_I(1*sizeof(mgcliststruct_t));
+ ctable->numelements = 0; // Initial number of elements in the hash
+
+ return ctable;
+}
+
+void mgchashInsert_I(mgchashtable_t * tbl, void * key, void *val) {