bug fixes
authorbdemsky <bdemsky>
Thu, 30 Jun 2011 01:01:17 +0000 (01:01 +0000)
committerbdemsky <bdemsky>
Thu, 30 Jun 2011 01:01:17 +0000 (01:01 +0000)
Robust/src/Runtime/bamboo/multicoregccompact.c
Robust/src/Runtime/bamboo/multicoremsg.c

index 8c26fdebdb8410b85dbaa0d2cf85eb67c44441ac..301c9b503f6e6888d8d87e0ed09af31e7c31cc11 100644 (file)
@@ -95,7 +95,6 @@ void useReturnedMem(unsigned int corenum, block_t localblockindex) {
        struct blockrecord * nextblockrecord=&allocationinfo.blocktable[blocknum];
        if (nextblockrecord->status==BS_FREE) {
          unsigned INTPTR freespace=nextblockrecord->freespace&~BAMBOO_CACHE_LINE_MASK;
-
          if (freespace>=memcheck) {
            nextblockrecord->status=BS_USED;
            void *blockptr=OFFSET2BASEVA(blocknum)+gcbaseva;
@@ -105,10 +104,13 @@ void useReturnedMem(unsigned int corenum, block_t localblockindex) {
            void *startaddr=blockptr+usedspace;
            gcrequiredmems[i]=0;
            maxusefulmems[i]=0;
-           if(BAMBOO_CHECK_SEND_MODE()) {
-             cache_msg_2_I(corenum,GCMOVESTART,startaddr);
+           if (i==STARTUPCORE) {
+             gctomove = true;
+             gcmovestartaddr = startaddr;
+           } else if(BAMBOO_CHECK_SEND_MODE()) {
+             cache_msg_2_I(i,GCMOVESTART,startaddr);
            } else {
-             send_msg_2_I(corenum,GCMOVESTART,startaddr);
+             send_msg_2_I(i,GCMOVESTART,startaddr);
            }
          }
        }
@@ -126,11 +128,13 @@ void handleReturnMem(unsigned int cnum, void *heaptop) {
 void getSpaceRemotely(struct moveHelper *to, unsigned int minimumbytes) {
   //need to get another block from elsewhere
   //set flag to wait for memory
+
   if (BAMBOO_NUM_OF_CORE==STARTUPCORE) {
     gctomove=false;
     BAMBOO_ENTER_RUNTIME_MODE_FROM_CLIENT();
     void *startaddr=handlegcfinishcompact_I(BAMBOO_NUM_OF_CORE, minimumbytes, gccurr_heaptop);
     BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME();
+
     if (startaddr) {
       gcmovestartaddr=startaddr;
     } else {
@@ -179,7 +183,6 @@ void compacthelper(struct moveHelper * orig,struct moveHelper * to) {
       senttopmessage=true;
     }
     unsigned int minimumbytes=compactblocks(orig, to);
-
     if (orig->ptr==orig->bound) {
       //need more data to compact
       //increment the core
@@ -194,7 +197,6 @@ void compacthelper(struct moveHelper * orig,struct moveHelper * to) {
       getSpace(to, minimumbytes);
     }
   }
-
   if (BAMBOO_NUM_OF_CORE==STARTUPCORE) {
     BAMBOO_ENTER_RUNTIME_MODE_FROM_CLIENT();
     handlegcfinishcompact_I(BAMBOO_NUM_OF_CORE, 0, 0);
@@ -403,6 +405,7 @@ unsigned int compactblocks(struct moveHelper * orig, struct moveHelper * to) {
       //tprintf("Decided to compact obj %x to %x\n", origptr, toptr);
 
       gcmappingtbl[OBJMAPPINGINDEX(origptr)]=toptr;
+
       origptr+=length;
       toptr=endtoptr;
     } else
index e67016e9bc34d0f683f4ecb87f027a38037a102b..a9fd40c7a1951bdf847e9818667adcb59e9e89b6 100644 (file)
@@ -396,7 +396,6 @@ INLINE void processmsg_memresponse_I() {
 #ifdef MULTICORE_GC
     bamboo_smem_size = numbytes;
     bamboo_cur_msp = memptr;
-    bamboo_smem_zero_top = bamboo_cur_msp;
 #else
     bamboo_smem_size = numbytes;
     bamboo_cur_msp =memptr;
@@ -419,7 +418,6 @@ INLINE void processmsg_gcstartpre_I() {
   bamboo_smem_size = 0;
   bamboo_cur_msp = NULL;
   smemflag = true;
-  bamboo_smem_zero_top = NULL;
 }
 
 INLINE void processmsg_gcstartinit_I() {
@@ -762,6 +760,7 @@ processmsg:
     // have some whole msg
     MSG_INDEXINC_I();
     msgdatafull = false;
+
     switch(type) {
 #ifdef TASK
     case TRANSOBJ: {