From cccf2766917197fbfcb6aa050c0b9ff6f0ca3d31 Mon Sep 17 00:00:00 2001 From: bdemsky Date: Wed, 22 Jun 2011 22:57:17 +0000 Subject: [PATCH] remove some debug code...fix a bug --- .../src/Runtime/bamboo/multicoregccompact.c | 6 ++--- Robust/src/Runtime/bamboo/multicoregcflush.c | 25 +------------------ 2 files changed, 4 insertions(+), 27 deletions(-) diff --git a/Robust/src/Runtime/bamboo/multicoregccompact.c b/Robust/src/Runtime/bamboo/multicoregccompact.c index 6487b1d7..bb5db5b4 100644 --- a/Robust/src/Runtime/bamboo/multicoregccompact.c +++ b/Robust/src/Runtime/bamboo/multicoregccompact.c @@ -51,11 +51,11 @@ void handleReturnMem_I(unsigned int cnum, void *heaptop) { struct blockrecord * blockrecord=&allocationinfo.blocktable[blockindex]; blockrecord->status=BS_FREE; - blockrecord->usedspace=(unsigned INTPTR)(heaptop-OFFSET2BASEVA(blockindex)); + blockrecord->usedspace=(unsigned INTPTR)(heaptop-OFFSET2BASEVA(blockindex)-gcbaseva); blockrecord->freespace=BLOCKSIZE(localblocknum)-blockrecord->usedspace; /* Update the lowest free block */ if (blockindex < allocationinfo.lowestfreeblock) { - blockindex=allocationinfo.lowestfreeblock; + allocationinfo.lowestfreeblock=blockindex; } /* This is our own block...means we should mark other blocks above us as free*/ @@ -412,7 +412,7 @@ void master_compact() { GCPROFILE_ITEM(); //just in case we didn't get blocks back... - if (allocationinfo.lowestfreeblock=NOFREEBLOCK) + if (allocationinfo.lowestfreeblock==NOFREEBLOCK) allocationinfo.lowestfreeblock=numblockspercore*NUMCORES4GC; GC_PRINTF("compact phase finished \n"); diff --git a/Robust/src/Runtime/bamboo/multicoregcflush.c b/Robust/src/Runtime/bamboo/multicoregcflush.c index fc89108f..d70a89c3 100644 --- a/Robust/src/Runtime/bamboo/multicoregcflush.c +++ b/Robust/src/Runtime/bamboo/multicoregcflush.c @@ -29,8 +29,6 @@ extern struct lockvector bamboo_threadlocks; #define UPDATEOBJ(obj, tt) {void *updatetmpptr=obj; if (updatetmpptr!=NULL) obj=updateObj(updatetmpptr);} #define UPDATEOBJNONNULL(obj, tt) {void *updatetmpptr=obj; obj=updateObj(updatetmpptr);} -#define dbpr() if (STARTUPCORE==BAMBOO_NUM_OF_CORE) tprintf("FL: %d\n", __LINE__); - INLINE void updategarbagelist(struct garbagelist *listptr) { for(;listptr!=NULL; listptr=listptr->next) { for(int i=0; isize; i++) { @@ -212,14 +210,6 @@ void * updateblocks(struct moveHelper * orig, struct moveHelper * to) { if (endtoptr>tobound||endtoptrptr=origptr; - if (BAMBOO_NUM_OF_CORE==STARTUPCORE) { - tprintf("dstptr=%x\n",dstptr); - tprintf("endtoptrptr=%x\n",endtoptr); - tprintf("tobound=%x\n",tobound); - tprintf("tobase=%x\n",tobase); - tprintf("origptr=%x\n",origptr); - tprintf("length=%d\n",length); - } return dstptr; } @@ -263,13 +253,9 @@ void updateOrigPtr(void *currtop) { void updatehelper(struct moveHelper * orig,struct moveHelper * to) { while(true) { - dbpr(); void *dstptr=updateblocks(orig, to); - dbpr(); if (dstptr) { - dbpr(); - printf("M: %x\n", dstptr); - //need more memory to compact into + //need more memory to compact into block_t blockindex; BLOCKINDEX(blockindex, dstptr); unsigned int corenum; @@ -286,9 +272,7 @@ void updatehelper(struct moveHelper * orig,struct moveHelper * to) { ; } } - dbpr(); if (orig->ptr==orig->bound) { - dbpr(); //inform others that we are done with previous block updateOrigPtr(orig->bound); @@ -304,7 +288,6 @@ void updatehelper(struct moveHelper * orig,struct moveHelper * to) { break; } } - dbpr(); } } @@ -312,19 +295,13 @@ void updateheap() { // initialize structs for compacting struct moveHelper orig={0,NULL,NULL,0,NULL,0,0,0,0}; struct moveHelper to={0,NULL,NULL,0,NULL,0,0,0,0}; - dbpr(); initOrig_Dst(&orig, &to); - dbpr(); updatehelper(&orig, &to); - dbpr(); } void update(struct garbagelist * stackptr) { - dbpr(); updateRuntimePtrs(stackptr); - dbpr(); updateheap(); - dbpr(); // send update finish message to core coordinator if(STARTUPCORE == BAMBOO_NUM_OF_CORE) { gccorestatus[BAMBOO_NUM_OF_CORE] = 0; -- 2.34.1