}
#ifdef MULTICORE
+struct MGCHash * allocateMGCHash_I(int size,
+ int conflicts) {
+ struct MGCHash *thisvar;
+ if (size <= 0) {
+#ifdef MULTICORE
+ BAMBOO_EXIT(0xf101);
+#else
+ printf("Negative Hashtable size Exception\n");
+ exit(-1);
+#endif
+ }
+ thisvar=(struct MGCHash *)RUNMALLOC_I(sizeof(struct MGCHash));
+ thisvar->size = size;
+ thisvar->bucket =
+ (struct MGCNode *) RUNMALLOC_I(sizeof(struct MGCNode)*size);
+ // zero out all the buckets
+ BAMBOO_MEMSET_WH(thisvar->bucket, '\0', sizeof(struct MGCNode)*size);
+ //Set data counts
+ thisvar->num4conflicts = conflicts;
+ return thisvar;
+}
+
int MGCHashadd_I(struct MGCHash * thisvar, int data) {
// Rehash code
unsigned int hashkey;
//void MGCHashrehash(struct MGCHash * thisvar);
int MGCHashadd(struct MGCHash *, int data);
#ifdef MULTICORE
+struct MGCHash * allocateMGCHash_I(int size, int conflicts);
int MGCHashadd_I(struct MGCHash *, int data);
#endif
int MGCHashcontains(struct MGCHash *,int data);
}
#ifdef MULTICORE
+struct Queue * createQueue_I() {
+ struct Queue * queue = (struct Queue *)RUNMALLOC_I(sizeof(struct Queue));
+ queue->head = NULL;
+ queue->tail = NULL;
+ return queue;
+}
+
struct QueueItem * addNewItem_I(struct Queue * queue, void * ptr) {
struct QueueItem * item=RUNMALLOC_I(sizeof(struct QueueItem));
item->objectptr=ptr;
struct QueueItem * addNewItem(struct Queue * queue, void * ptr);
struct QueueItem * addNewItemBack(struct Queue * queue, void * ptr);
#ifdef MULTICORE
+struct Queue * createQueue_I();
struct QueueItem * addNewItem_I(struct Queue * queue, void * ptr);
#endif
}
#ifdef MULTICORE
+struct RuntimeHash * allocateRuntimeHash_I(int size) {
+ struct RuntimeHash *thisvar; //=(struct RuntimeHash *)RUNMALLOC(sizeof(struct RuntimeHash));
+ if (size <= 0) {
+#ifdef MULTICORE
+ BAMBOO_EXIT(0xf101);
+#else
+ printf("Negative Hashtable size Exception\n");
+ exit(-1);
+#endif
+ }
+ thisvar=(struct RuntimeHash *)RUNMALLOC_I(sizeof(struct RuntimeHash));
+ thisvar->size = size;
+ thisvar->bucket = (struct RuntimeNode **) RUNMALLOC_I(sizeof(struct RuntimeNode *)*size);
+ /* Set allocation blocks*/
+ thisvar->listhead=NULL;
+ thisvar->listtail=NULL;
+ /*Set data counts*/
+ thisvar->numelements = 0;
+ return thisvar;
+}
+
int RuntimeHashadd_I(struct RuntimeHash * thisvar,int key, int data) {
/* Rehash code */
unsigned int hashkey;
void RuntimeHashrehash(struct RuntimeHash * thisvar);
int RuntimeHashadd(struct RuntimeHash *, int key, int data);
#ifdef MULTICORE
+struct RuntimeHash * allocateRuntimeHash_I(int size);
int RuntimeHashadd_I(struct RuntimeHash *, int key, int data);
#endif
int RuntimeHashremovekey(struct RuntimeHash *,int key);
// should be cleared whenever enter a task
// data structures for shared memory allocation
+#ifdef TILERA_BME
#define BAMBOO_BASE_VA 0xd000000
+#elif defined TILERA_ZLINUX
+#ifdef MULTICORE_GC
+#define BAMBOO_BASE_VA 0xd000000
+#endif // MULTICORE_GC
+#endif // TILERA_BME
#ifdef GC_DEBUG
#include "structdefs.h"
#define BAMBOO_NUM_PAGES (NUMCORES4GC*(2+1)+3)
smemflag = true;
bamboo_cur_msp = NULL;
bamboo_smem_size = 0;
- totransobjqueue = createQueue();
+ totransobjqueue = createQueue_I();
#ifdef MULTICORE_GC
gcflag = false;
gcself_numreceiveobjs = 0;
gcmarkedptrbound = 0;
//mgchashCreate(2000, 0.75);
- gcpointertbl = allocateRuntimeHash(20);
+ gcpointertbl = allocateRuntimeHash_I(20);
//gcpointertbl = allocateMGCHash(20);
- gcforwardobjtbl = allocateMGCHash(20, 3);
+ gcforwardobjtbl = allocateMGCHash_I(20, 3);
gcobj2map = 0;
gcmappedobj = 0;
gcismapped = false;
lock2require = 0;
lockresult = 0;
lockflag = false;
- lockRedirectTbl = allocateRuntimeHash(20);
- objRedirectLockTbl = allocateRuntimeHash(20);
+ lockRedirectTbl = allocateRuntimeHash_I(20);
+ objRedirectLockTbl = allocateRuntimeHash_I(20);
#endif
#ifndef INTERRUPT
reside = false;