bug fixes...still doesn't work
authorbdemsky <bdemsky>
Tue, 21 Jun 2011 01:36:18 +0000 (01:36 +0000)
committerbdemsky <bdemsky>
Tue, 21 Jun 2011 01:36:18 +0000 (01:36 +0000)
Robust/src/Runtime/bamboo/multicoregarbage.c
Robust/src/Runtime/bamboo/multicoregarbage.h
Robust/src/Runtime/bamboo/multicoremem.c

index 474033e8ab5302e56c013e3d850966d8f1b3b3a8..c23a78dd73f9931c8f93b1268648e646ad589ee2 100644 (file)
@@ -108,6 +108,9 @@ void initmulticoregcdata() {
        allocationinfo.blocktable[i].corenum=0;
       else
        allocationinfo.blocktable[i].corenum=gc_block2core[(i%(NUMCORES4GC*2))];
+      allocationinfo.blocktable[i].status=BS_FREE;
+      allocationinfo.blocktable[i].usedspace=0;
+      allocationinfo.blocktable[i].freespace=GLOBALBLOCKSIZE(i);
     }
     buildCore2Test();
   }
index d66261d7368f307830265b8d86fd587d194a2ef2..94f8c183145fd1766c83edfb47dbb2e1470791be 100644 (file)
@@ -233,6 +233,10 @@ INLINE static unsigned int hostcore(void * ptr) {
 #define BLOCKSIZE(c) \
   ((c)?BAMBOO_SMEM_SIZE_L:BAMBOO_SMEM_SIZE)
 
+//This macro takes in a local block number and returns the size of the block
+#define GLOBALBLOCKSIZE(c) \
+  ((c<NUMCORES4GC)?BAMBOO_SMEM_SIZE_L:BAMBOO_SMEM_SIZE)
+
 //Takes as input the core number c and the local block index n and
 //returns the global block index
 
index d0ca1a3fa04ce515135223564a73f6b0399c9402..145398bb85d3ce033c8ab0bf9f601b7f950ffed7 100644 (file)
@@ -81,7 +81,7 @@ void * globalmalloc_I(int coren, unsigned INTPTR memcheck, int * allocsize) {
 
 void * smemalloc(int coren, int isize, int * allocsize) {
   BAMBOO_ENTER_RUNTIME_MODE_FROM_CLIENT();
-  void *retval=smemalloc(coren, isize, allocsize);
+  void *retval=smemalloc_I(coren, isize, allocsize);
   BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME();
   return retval;
 }
@@ -97,7 +97,6 @@ void * smemalloc_I(int coren, int isize, int * allocsize) {
 #elif defined(SMEMG)
   void *mem = globalmalloc_I(coren, isize, allocsize);
 #endif
-
   if(mem == NULL) {
     // no enough shared global memory
     // trigger gc