unsigned int blockindex;
BLOCKINDEX(blockindex, heaptop);
unsigned INTPTR localblocknum=GLOBALBLOCK2LOCAL(blockindex);
+ tprintf("Returned mem for core %d\n", cnum);
//this core is done as far as memory usage is concerned
returnedmem[cnum]=0;
} else {
while(!gctomove) ;
}
- printf("B: %d\n", BAMBOO_NUM_OF_CORE);
+ printf("BX: %d\n", BAMBOO_NUM_OF_CORE);
} else {
- printf("C: %d\n", BAMBOO_NUM_OF_CORE);
+ printf("CX: %d\n", BAMBOO_NUM_OF_CORE);
gctomove=false;
//send request for memory
send_msg_4(STARTUPCORE,GCFINISHCOMPACT,BAMBOO_NUM_OF_CORE, minimumbytes, gccurr_heaptop);
//wait for flag to be set that we received message
- while(!gctomove) ;
- printf("D: %d\n", BAMBOO_NUM_OF_CORE);
+ printf("XD: %d\n", BAMBOO_NUM_OF_CORE);
+ int cc=0;
+ while(!gctomove) {
+ cc++;
+ if ((cc%100000)==0)
+ printf("Z");
+ }
+ printf("DD: %d\n", BAMBOO_NUM_OF_CORE);
}
//store pointer
while(true) {
if ((gccurr_heaptop < ((unsigned INTPTR)(to->bound-to->ptr)))&&!senttopmessage) {
//This block is the last for this core...let the startup know
+ printf("gchtp=%u tobound=%x toptr=%x\n", gccurr_heaptop, to->bound, to->ptr);
+ printf("Sending return %d\n", BAMBOO_NUM_OF_CORE);
if (BAMBOO_NUM_OF_CORE==STARTUPCORE) {
handleReturnMem(BAMBOO_NUM_OF_CORE, to->ptr+gccurr_heaptop);
} else {
senttopmessage=true;
}
unsigned int minimumbytes=compactblocks(orig, to);
+ printf("optr=%x obound=%x\n",orig->ptr, orig->bound);
if (orig->ptr==orig->bound) {
//need more data to compact
//increment the core
break;
}
if (minimumbytes!=0) {
+ printf("%d needs %u bytes.\n",BAMBOO_NUM_OF_CORE,minimumbytes);
getSpace(to, minimumbytes);
}
}
} else {
send_msg_4(STARTUPCORE,GCFINISHCOMPACT,BAMBOO_NUM_OF_CORE, 0, 0);
}
-
}
void * checkNeighbors_I(int corenum, unsigned INTPTR requiredmem, unsigned INTPTR desiredmem) {
// If we cannot find spare mem right now, hold the request
gcrequiredmems[requiredcore] = requiredmem;
+ maxusefulmems[requiredcore]=desiredmem;
gcmovepending++;
int count=gc_countRunningCores();
void *origbound=orig->bound;
unsigned INTPTR origendoffset=ALIGNTOTABLEINDEX((unsigned INTPTR)(origbound-gcbaseva));
unsigned int objlength;
-
while(origptr<origbound) {
//Try to skip over stuff fast first
unsigned INTPTR offset=(unsigned INTPTR) (origptr-gcbaseva);
} else
origptr+=ALIGNMENTSIZE;
}
+ to->ptr=toptr;
+ orig->ptr=origptr;
+ return 0;
}
void compact() {
compact();
/* wait for all cores to finish compacting */
tprintf("MASTER WAITING\n");
+
while(!gc_checkCoreStatus())
;