#endif
-/* MGCHASH ********************************************************/
-mgchashlistnode_t *mgc_table;
-unsigned int mgc_size;
-unsigned INTPTR mgc_mask;
-unsigned int mgc_numelements;
-unsigned int mgc_threshold;
-double mgc_loadfactor;
-mgcliststruct_t *mgc_structs;
-
-void mgchashCreate(unsigned int size, double loadfactor) {
+/* mgchash ********************************************************/
+mgchashtable_t * mgchashCreate(unsigned int size, double loadfactor) {
mgchashtable_t *ctable;
mgchashlistnode_t *nodes;
int i;
- // Allocate space for the hash table
- mgc_table = RUNMALLOC(size*sizeof(mgchashlistnode_t));
- mgc_loadfactor = loadfactor;
- mgc_size = size;
- mgc_threshold=size*loadfactor;
-
-#ifdef BIT64
- mgc_mask = ((size << 6)-1)&~(15UL);
+ if (size <= 0) {
+#ifdef MULTICORE
+ BAMBOO_EXIT(0xf101);
#else
- mgc_mask = ((size << 6)-1)&~15;
+ printf("Negative Hashtable size Exception\n");
+ exit(-1);
#endif
+ }
- mgc_structs=RUNMALLOC(1*sizeof(mgcliststruct_t));
- mgc_numelements = 0; // Initial number of elements in the hash
+ // Allocate space for the hash table
+ ctable = (mgchashtable_t *)RUNMALLOC(sizeof(mgchashtable_t));
+ if(ctable == NULL) {
+ // Run out of local memory
+ BAMBOO_EXIT(0xf102);
+ }
+ ctable->table = (mgchashlistnode_t*)RUNMALLOC(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(1*sizeof(mgcliststruct_t));
+ ctable->numelements = 0; // Initial number of elements in the hash
+
+ return ctable;
}
-void mgchashreset() {
- mgchashlistnode_t *ptr = mgc_table;
+void mgchashreset(mgchashtable_t * tbl) {
+ mgchashlistnode_t *ptr = tbl->table;
int i;
- /*if (mgc_numelements<(mgc_size>>6)) {
- mgchashlistnode_t *top=&ptr[mgc_size];
- mgchashlistnode_t *tmpptr=mgc_list;
- while(tmpptr!=NULL) {
- mgchashlistnode_t *next=tmpptr->lnext;
- if (tmpptr>=ptr&&tmpptr<top) {
- //zero in list
- tmpptr->key=NULL;
- tmpptr->next=NULL;
+ if (tbl->numelements<(tbl->size>>6)) {
+ mgchashlistnode_t *top=&ptr[tbl->size];
+ mgchashlistnode_t * list = tbl->list;
+ while(list != NULL) {
+ mgchashlistnode_t * next = list->next;
+ if ((list >= ptr) && (list < top)) {
+ //zero in list
+ list->key=NULL;
+ list->next=NULL;
}
- tmpptr=next;
- }
- } else {*/
- BAMBOO_MEMSET_WH(mgc_table, '\0', sizeof(mgchashlistnode_t)*mgc_size);
- //}
- while(mgc_structs->next!=NULL) {
- mgcliststruct_t *next=mgc_structs->next;
- RUNFREE(mgc_structs);
- mgc_structs=next;
+ list = next;
+ }
+ } else {
+ BAMBOO_MEMSET_WH(tbl->table, '\0', sizeof(mgchashlistnode_t)*tbl->size);
+ }
+ // TODO now never release any allocated memory, may need to be changed
+ mgcliststruct_t * next = tbl->structs;
+ while(/*tbl->structs->*/next!=NULL) {
+ /*mgcliststruct_t * next = tbl->structs->next;
+ RUNFREE(tbl->structs);
+ tbl->structs=next;*/
+ next->num = 0;
+ next = next->next;
}
- mgc_structs->num = 0;
- mgc_numelements = 0;
+ //tbl->structs->num = 0;
+ tbl->numelements = 0;
}
//Store objects and their pointers into hash
-void mgchashInsert(void * key, void *val) {
+void mgchashInsert(mgchashtable_t * tbl, void * key, void *val) {
mgchashlistnode_t *ptr;
- if(mgc_numelements > (mgc_threshold)) {
+ if(tbl->numelements > (tbl->threshold)) {
//Resize
- unsigned int newsize = mgc_size << 1 + 1;
- mgchashResize(newsize);
+ unsigned int newsize = tbl->size << 1 + 1;
+ mgchashResize(tbl, newsize);
}
- //int hashkey = (unsigned int)key % mgc_size;
- ptr=&mgc_table[(((unsigned INTPTR)key)&mgc_mask)>>6]; //&mgc_table[hashkey];
- mgc_numelements++;
+ ptr=&tbl->table[(((unsigned INTPTR)key)&tbl->mask)>>6];
+ tbl->numelements++;
if(ptr->key==0) {
// the first time insert a value for the key
ptr->val=val;
} else { // Insert in the beginning of linked list
mgchashlistnode_t * node;
- if (mgc_structs->num<NUMMGCLIST) {
- node=&mgc_structs->array[mgc_structs->num];
- mgc_structs->num++;
+ if (tbl->structs->num<NUMMGCLIST) {
+ node=&tbl->structs->array[tbl->structs->num];
+ tbl->structs->num++;
} else {
//get new list
mgcliststruct_t *tcl=RUNMALLOC(1*sizeof(mgcliststruct_t));
- tcl->next=mgc_structs;
- mgc_structs=tcl;
+ tcl->next=tbl->structs;
+ tbl->structs=tcl;
node=&tcl->array[0];
tcl->num=1;
}
}
#ifdef MULTICORE_GC
-void mgchashInsert_I(void * key, void *val) {
+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) {
mgchashlistnode_t *ptr;
- if(mgc_numelements > (mgc_threshold)) {
+ if(tbl->numelements > (tbl->threshold)) {
//Resize
- unsigned int newsize = mgc_size << 1 + 1;
- mgchashResize_I(newsize);
+ unsigned int newsize = tbl->size << 1 + 1;
+ mgchashResize_I(tbl, newsize);
}
- //int hashkey = (unsigned int)key % mgc_size;
- //ptr=&mgc_table[hashkey];
- ptr = &mgc_table[(((unsigned INTPTR)key)&mgc_mask)>>6];
- mgc_numelements++;
+ ptr = &tbl->table[(((unsigned INTPTR)key)&tbl->mask)>>6];
+ tbl->numelements++;
if(ptr->key==0) {
ptr->key=key;
return;
} else { // Insert in the beginning of linked list
mgchashlistnode_t * node;
- if (mgc_structs->num<NUMMGCLIST) {
- node=&mgc_structs->array[mgc_structs->num];
- mgc_structs->num++;
+ if (tbl->structs->num<NUMMGCLIST) {
+ node=&tbl->structs->array[tbl->structs->num];
+ tbl->structs->num++;
} else {
//get new list
mgcliststruct_t *tcl=RUNMALLOC_I(1*sizeof(mgcliststruct_t));
- tcl->next=mgc_structs;
- mgc_structs=tcl;
+ tcl->next=tbl->structs;
+ tbl->structs=tcl;
node=&tcl->array[0];
tcl->num=1;
}
#endif
// Search for an address for a given oid
-INLINE void * mgchashSearch(void * key) {
+INLINE void * mgchashSearch(mgchashtable_t * tbl, void * key) {
//REMOVE HASH FUNCTION CALL TO MAKE SURE IT IS INLINED HERE]
- //int hashkey = (unsigned int)key % mgc_size;
- mgchashlistnode_t *node = &mgc_table[(((unsigned INTPTR)key)&mgc_mask)>>6];
- //&mgc_table[hashkey];
+ mgchashlistnode_t *node = &tbl->table[(((unsigned INTPTR)key)&tbl->mask)>>6];
do {
if(node->key == key) {
return NULL;
}
-unsigned int mgchashResize(unsigned int newsize) {
- mgchashlistnode_t *node, *ptr, *curr; // curr and next keep track of the current and the next mgchashlistnodes in a linked list
+unsigned int mgchashResize(mgchashtable_t * tbl, unsigned int newsize) {
+ mgchashlistnode_t *node, *ptr, *curr; // curr and next keep track of the
+ // current and the next
+ // mgchashlistnodes in a linked list
unsigned int oldsize;
- int isfirst; // Keeps track of the first element in the chashlistnode_t for each bin in hashtable
+ int isfirst; // Keeps track of the first element in the
+ // chashlistnode_t for each bin in hashtable
unsigned int i,index;
unsigned int mask;
- ptr = mgc_table;
- oldsize = mgc_size;
+ ptr = tbl->table;
+ oldsize = tbl->size;
if((node = RUNMALLOC(newsize*sizeof(mgchashlistnode_t))) == NULL) {
printf("Calloc error %s %d\n", __FILE__, __LINE__);
return 1;
}
- mgc_table = node; //Update the global hashtable upon resize()
- mgc_size = newsize;
- mgc_threshold = newsize * mgc_loadfactor;
- mask=mgc_mask = (newsize << 6)-1;
+ tbl->table = node; //Update the global hashtable upon resize()
+ tbl->size = newsize;
+ tbl->threshold = newsize * tbl->loadfactor;
+ mask = tbl->mask = (newsize << 6) - 1;
- for(i = 0; i < oldsize; i++) { //Outer loop for each bin in hash table
+ for(i = 0; i < oldsize; i++) { //Outer loop for each bin in hash table
curr = &ptr[i];
isfirst = 1;
- do { //Inner loop to go through linked lists
+ do { //Inner loop to go through linked lists
void * key;
mgchashlistnode_t *tmp,*next;
- if ((key=curr->key) == 0) { //Exit inner loop if there the first element is 0
- break; //key = val =0 for element if not present within the hash table
- }
- //index = (unsigned int)key % mgc_size;
- index = (((unsigned INTPTR)key) & mask) >>6;
+ if ((key=curr->key) == 0) {
+ //Exit inner loop if there the first element is 0
+ break;
+ //key = val =0 for element if not present within the hash table
+ }
+ index = (((unsigned INTPTR)key) & mask) >> 6;
tmp=&node[index];
next = curr->next;
// Insert into the new table
if(tmp->key == 0) {
- tmp->key = key;
- tmp->val = curr->val;
+ tmp->key = key;
+ tmp->val = curr->val;
} /*
NOTE: Add this case if you change this...
- This case currently never happens because of the way things rehash....
+ This case currently never happens because of the way things rehash....*/
else if (isfirst) {
- chashlistnode_t *newnode= calloc(1, sizeof(chashlistnode_t));
- newnode->key = curr->key;
- newnode->val = curr->val;
- newnode->next = tmp->next;
- tmp->next=newnode;
- } */
+ mgchashlistnode_t *newnode= RUNMALLOC(1*sizeof(mgchashlistnode_t));
+ newnode->key = curr->key;
+ newnode->val = curr->val;
+ newnode->next = tmp->next;
+ tmp->next=newnode;
+ }
else {
- curr->next=tmp->next;
- tmp->next=curr;
+ curr->next=tmp->next;
+ tmp->next=curr;
}
isfirst = 0;
}
#ifdef MULTICORE_GC
-unsigned int mgchashResize_I(unsigned int newsize) {
- mgchashlistnode_t *node, *ptr, *curr; // curr and next keep track of the current and the next mgchashlistnodes in a linked list
+unsigned int mgchashResize_I(mgchashtable_t * tbl, unsigned int newsize) {
+ mgchashlistnode_t *node, *ptr, *curr; // curr and next keep track of the
+ // current and the next
+ // mgchashlistnodes in a linked list
unsigned int oldsize;
- int isfirst; // Keeps track of the first element in the chashlistnode_t for each bin in hashtable
+ int isfirst; // Keeps track of the first element in the chashlistnode_t
+ // for each bin in hashtable
unsigned int i,index;
unsigned int mask;
- ptr = mgc_table;
- oldsize = mgc_size;
+ ptr = tbl->table;
+ oldsize = tbl->size;
if((node = RUNMALLOC_I(newsize*sizeof(mgchashlistnode_t))) == NULL) {
- BAMBOO_EXIT(0xe001);
+ BAMBOO_EXIT(0xf104);
printf("Calloc error %s %d\n", __FILE__, __LINE__);
return 1;
}
- mgc_table = node; //Update the global hashtable upon resize()
- mgc_size = newsize;
- mgc_threshold = newsize * mgc_loadfactor;
- mask=mgc_mask = (newsize << 6)-1;
+ tbl->table = node; //Update the global hashtable upon resize()
+ tbl->size = newsize;
+ tbl->threshold = newsize * tbl->loadfactor;
+ mask = tbl->mask = (newsize << 6)-1;
- for(i = 0; i < oldsize; i++) { //Outer loop for each bin in hash table
+ for(i = 0; i < oldsize; i++) { //Outer loop for each bin in hash table
curr = &ptr[i];
isfirst = 1;
- do { //Inner loop to go through linked lists
+ do { //Inner loop to go through linked lists
void * key;
mgchashlistnode_t *tmp,*next;
if ((key=curr->key) == 0) {
- //Exit inner loop if there the first element is 0
- break;
- //key = val =0 for element if not present within the hash table
+ //Exit inner loop if there the first element is 0
+ break;
+ //key = val =0 for element if not present within the hash table
}
- //index = (unsigned int)key % mgc_size;
index = (((unsigned INTPTR)key) & mask) >>6;
tmp=&node[index];
next = curr->next;
// Insert into the new table
if(tmp->key == 0) {
- tmp->key = key;
- tmp->val = curr->val;
+ tmp->key = key;
+ tmp->val = curr->val;
} /*
NOTE: Add this case if you change this...
This case currently never happens because of the way things rehash....*/
else if (isfirst) {
- mgchashlistnode_t *newnode=RUNMALLOC_I(1*sizeof(mgchashlistnode_t));
- newnode->key = curr->key;
- newnode->val = curr->val;
- newnode->next = tmp->next;
- tmp->next=newnode;
+ mgchashlistnode_t *newnode=RUNMALLOC_I(1*sizeof(mgchashlistnode_t));
+ newnode->key = curr->key;
+ newnode->val = curr->val;
+ newnode->next = tmp->next;
+ tmp->next=newnode;
} else {
- curr->next=tmp->next;
- tmp->next=curr;
+ curr->next=tmp->next;
+ tmp->next=curr;
}
isfirst = 0;
curr = next;
} while(curr!=NULL);
}
- RUNFREE(ptr); //Free the memory of the old hash table
+ RUNFREE(ptr); //Free the memory of the old hash table
return 0;
}
#endif
//Delete the entire hash table
-void mgchashDelete() {
+void mgchashDelete(mgchashtable_t * tbl) {
int i;
- mgcliststruct_t *ptr=mgc_structs;
+ mgcliststruct_t *ptr=tbl->structs;
while(ptr!=NULL) {
mgcliststruct_t *next=ptr->next;
RUNFREE(ptr);
ptr=next;
}
- RUNFREE(mgc_table);
- mgc_table=NULL;
- mgc_structs=NULL;
+ RUNFREE(tbl->table);
+ tbl->table=NULL;
+ tbl->structs=NULL;
}
+/* MGCHASH ********************************************************/
+
struct MGCHash * allocateMGCHash(int size,
int conflicts) {
struct MGCHash *thisvar;
if (size <= 0) {
#ifdef MULTICORE
- BAMBOO_EXIT(0xf101);
+ BAMBOO_EXIT(0xf105);
#else
printf("Negative Hashtable size Exception\n");
exit(-1);
struct MGCHash *thisvar;
if (size <= 0) {
#ifdef MULTICORE
- BAMBOO_EXIT(0xf101);
+ BAMBOO_EXIT(0xf106);
#else
printf("Negative Hashtable size Exception\n");
exit(-1);
}
gclobjhead->next = gclobjhead->prev = NULL;
+#ifdef LOCALHASHTBL_TEST
freeRuntimeHash(gcpointertbl);
gcpointertbl = allocateRuntimeHash(20);
+#else
+ mgchashreset(gcpointertbl);
+#endif
//gcpointertbl = allocateMGCHash(20);
- //mgchashreset();
freeMGCHash(gcforwardobjtbl);
gcforwardobjtbl = allocateMGCHash(20, 3);
}
// fill the remaining space with -2 padding
BAMBOO_MEMSET_WH(tmpheaptop+size, -2, isize-size);
- // zero out original mem caching the lobj
- //BAMBOO_MEMSET_WH(gcheaptop, '\0', size); // TODO ??
#ifdef DEBUG
BAMBOO_DEBUGPRINT(0xea05);
BAMBOO_DEBUGPRINT_REG(gcheaptop);
// cache the mapping info anyway
//if(ptr != tmpheaptop) {
BAMBOO_ENTER_RUNTIME_MODE_FROM_CLIENT();
- //mgchashInsert_I(ptr, tmpheaptop);
+#ifdef LOCALHASHTBL_TEST
RuntimeHashadd_I(gcpointertbl, ptr, tmpheaptop);
- //struct nodemappinginfo * nodeinfo = NULL;
- //RuntimeHashget(gcpointertbl, ptr, &nodeinfo);
- //nodeinfo->ptr = tmpheaptop;
+#else
+ mgchashInsert_I(gcpointertbl, ptr, tmpheaptop);
+#endif
//MGCHashadd_I(gcpointertbl, ptr, tmpheaptop);
BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME();
//}
// cache the mapping info anyway
//if(ptr != tmpheaptop) {
BAMBOO_ENTER_RUNTIME_MODE_FROM_CLIENT();
- //mgchashInsert_I(ptr, tmpheaptop);
+#ifdef LOCALHASHTBL_TEST
RuntimeHashadd_I(gcpointertbl, ptr, tmpheaptop);
- //struct nodemappinginfo * nodeinfo = NULL;
- //RuntimeHashget(gcpointertbl, ptr, &nodeinfo);
- //nodeinfo->ptr = tmpheaptop;
+#else
+ mgchashInsert_I(gcpointertbl, ptr, tmpheaptop);
+#endif
//MGCHashadd_I(gcpointertbl, ptr, tmpheaptop);
BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME();
//}
}
// store mapping info
BAMBOO_ENTER_RUNTIME_MODE_FROM_CLIENT();
- //mgchashInsert_I(orig->ptr, to->ptr);
+#ifdef LOCALHASHTBL_TEST
RuntimeHashadd_I(gcpointertbl, orig->ptr, to->ptr);
+#else
+ mgchashInsert_I(gcpointertbl, orig->ptr, to->ptr);
+#endif
+ //MGCHashadd_I(gcpointertbl, orig->ptr, to->ptr);
if(isremote) {
#ifdef GC_PROFILE
//unsigned long long ttimet = BAMBOO_GET_EXE_TIME();
//flushstalltime_i += BAMBOO_GET_EXE_TIME()-ttimet;
#endif
}
- //MGCHashadd_I(gcpointertbl, orig->ptr, to->ptr);
BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME();
//}
#ifdef DEBUG
#ifdef GC_PROFILE
unsigned long long ttime = BAMBOO_GET_EXE_TIME();
#endif
- //dstptr = mgchashSearch(objptr);
+#ifdef LOCALHASHTBL_TEST
RuntimeHashget(gcpointertbl, objptr, &dstptr);
+#else
+ dstptr = mgchashSearch(gcpointertbl, objptr);
+#endif
+ //MGCHashget(gcpointertbl, objptr, &dstptr);
#ifdef GC_PROFILE
flushstalltime += BAMBOO_GET_EXE_TIME()-ttime;
#endif
- //MGCHashget(gcpointertbl, objptr, &dstptr);
BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME();
#ifdef DEBUG
BAMBOO_DEBUGPRINT_REG(dstptr);
//GCSharedHashget(sptbl, (int)objptr, &dstptr);
dstptr = mgcsharedhashSearch(sptbl, (int)objptr);
if(dstptr != NULL) {
+#ifdef LOCALHASHTBL_TEST
RuntimeHashadd_I(gcpointertbl, (int)objptr, (int)dstptr);
+#else
+ mgchashInsert_I(gcpointertbl, (int)objptr, (int)dstptr);
+#endif
}
}
BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME();
//flushstalltime += BAMBOO_GET_EXE_TIME() - ttime;
#endif
BAMBOO_ENTER_RUNTIME_MODE_FROM_CLIENT();
- //dstptr = mgchashSearch(objptr);
+#ifdef LOCALHASHTBL_TEST
RuntimeHashget(gcpointertbl, objptr, &dstptr);
+#else
+ dstptr = mgchashSearch(gcpointertbl, objptr);
+#endif
//MGCHashget(gcpointertbl, objptr, &dstptr);
BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME();
} // if(dstptr == NULL)
gcself_numsendobjs = 0;
gcself_numreceiveobjs = 0;
gcmarkedptrbound = 0;
- //mgchashCreate(2000, 0.75);
+#ifdef LOCALHASHTBL_TEST
gcpointertbl = allocateRuntimeHash_I(20);
- //gcpointertbl = allocateMGCHash(20);
+#else
+ gcpointertbl = mgchashCreate_I(2000, 0.75);
+#endif
+ //gcpointertbl = allocateMGCHash_I(20);
gcforwardobjtbl = allocateMGCHash_I(20, 3);
gcobj2map = 0;
gcmappedobj = 0;
inline __attribute__((always_inline))
void disruntimedata() {
#ifdef MULTICORE_GC
- //mgchashDelete();
+#ifdef LOCALHASHTBL_TEST
freeRuntimeHash(gcpointertbl);
+#else
+ mgchashDelete(gcpointertbl);
+#endif
//freeMGCHash(gcpointertbl);
freeMGCHash(gcforwardobjtbl);
// for mapping info structures
void * dstptr = NULL;
int data1 = msgdata[msgdataindex];
MSG_INDEXINC_I();
- //dstptr = mgchashSearch(msgdata[1]);
#ifdef GC_PROFILE
// TODO unsigned long long ttime = BAMBOO_GET_EXE_TIME();
#endif
+#ifdef LOCALHASHTBL_TEST
RuntimeHashget(gcpointertbl, data1, &dstptr);
+#else
+ dstptr = mgchashSearch(gcpointertbl, data1);
+#endif
+ //MGCHashget(gcpointertbl, data1, &dstptr);
#ifdef GC_PROFILE
// TODO flushstalltime += BAMBOO_GET_EXE_TIME() - ttime;
#endif
int data2 = msgdata[msgdataindex];
MSG_INDEXINC_I();
- //MGCHashget(gcpointertbl, msgdata[1], &dstptr);
#ifdef GC_PROFILE
// TODO unsigned long long ttimei = BAMBOO_GET_EXE_TIME();
#endif
#endif
int data1 = msgdata[msgdataindex];
MSG_INDEXINC_I();
- gcmappedobj = msgdata[msgdataindex]; // [2]
- MSG_INDEXINC_I();
- //mgchashReplace_I(msgdata[1], msgdata[2]);
- //mgchashInsert_I(gcobj2map, gcmappedobj);
- RuntimeHashadd_I(gcpointertbl, gcobj2map, gcmappedobj);
- /*struct nodemappinginfo * nodeinfo =
- (struct nodemappinginfo *)RUNMALLOC_I(sizeof(struct nodemappinginfo));
- nodeinfo->ptr = (void *)gcmappedobj;
- nodeinfo->cores = NULL;
- RuntimeHashadd_I(gcpointertbl, data1, (int)nodeinfo);*/
- //MGCHashadd_I(gcpointertbl, gcobj2map, gcmappedobj);
+ gcmappedobj = msgdata[msgdataindex]; // [2]
+ MSG_INDEXINC_I();
+#ifdef LOCALHASHTBL_TEST
+ RuntimeHashadd_I(gcpointertbl, data1, gcmappedobj);
+#else
+ mgchashInsert_I(gcpointertbl, data1, gcmappedobj);
+#endif
+ //MGCHashadd_I(gcpointertbl, data1, gcmappedobj);
if(data1 == gcobj2map) {
gcismapped = true;
}
MSG_INDEXINC_I();
int data2 = msgdata[msgdataindex];
MSG_INDEXINC_I();
- //mgchashInsert_I(msgdata[1], msgdata[2]);
+#ifdef LOCALHASHTBL_TEST
RuntimeHashadd_I(gcpointertbl, data1, data2);
+#else
+ mgchashInsert_I(gcpointertbl, data1, data2);
+#endif
+ //MGCHashadd_I(gcpointertbl, data1, data2);
mgcsharedhashInsert_I(gcsharedptbl, data1, data2);
- //GCSharedHashadd_I(gcsharedptbl, data1, data2);
- //MGCHashadd_I(gcpointertbl, msgdata[1], msgdata[2]);
}
#endif // #ifdef MULTICORE_GC