if (!lower) {
//We're resetting the boundaries of units at the low address end of the region...
//Be sure not to reset the boundary of our last unit...it is shared with another region
-
+ //Very bottom most unit defines boundary of region...we can't move that right now
+ while((endunit<region->startptr)&&(currunit<highbound)) {
+ pmc_heapptr->units[currunit].endptr=region->startptr;
+ //tprintf("Ch6: %u -> %x\n", currunit, endunit);
+ currunit++;
+ endunit=pmc_unitend(currunit);
+ }
while(endunit<=region->lastptr&&(currunit<highbound)) {
pmc_heapptr->units[currunit].endptr=endunit;
//tprintf("Ch2: %u -> %x\n", currunit, endunit);
//tprintf("done\n");
//if (BAMBOO_NUM_OF_CORE==STARTUPCORE) {
- // for(int i=0;i<NUMCORES4GC;i+=2) {
- // void *startptr=pmc_heapptr->regions[i].lastptr;
- // void *finishptr=pmc_heapptr->regions[i+1].lastptr;
- // tprintf("Partition %u from %x to %x\n", i, startptr, finishptr);
- // tprintf("%x %x %x %x\n", pmc_heapptr->regions[i].startptr, pmc_heapptr->regions[i].endptr, pmc_heapptr->regions[i+1].startptr, pmc_heapptr->regions[i+1].endptr);
- // }
+ // for(int i=0;i<NUMCORES4GC;i+=2) {
+ // void *startptr=pmc_heapptr->regions[i].lastptr;
+ // void *finishptr=pmc_heapptr->regions[i+1].lastptr;
+ // tprintf("Partition %u from %x to %x\n", i, startptr, finishptr);
+ // tprintf("%x %x %x %x\n", pmc_heapptr->regions[i].startptr, pmc_heapptr->regions[i].endptr, pmc_heapptr->regions[i+1].startptr, pmc_heapptr->regions[i+1].endptr);
+ // }
// }
gcflag=false;
void gettype_size(void * ptr, unsigned int * ttype, unsigned int * tsize) {
int type = ((int *)ptr)[0];
- // if (type>TOTALNUMCLASSANDARRAY) {
+ // if ((type>TOTALNUMCLASSANDARRAY)||(type<0)) {
// tprintf("ptr=%x type=%u\n", ptr, type);
+ // BAMBOO_EXIT();
// }
if(type < NUMCLASSES) {
//update unit end points
for(unsigned int index=startindex;index<(endindex-1);index++) {
- void *ptr=pmc_unitend(index);
+ void *ptr=(pmc_unitend(index)>pmc_heapptr->units[index].endptr)?(pmc_unitend(index)):(pmc_heapptr->units[index].endptr);
if ((ptr>startptr)&&(ptr<=newstartptr)) {
//tprintf("Ch: %u -> %x\n", index, newstartptr);
pmc_heapptr->units[index].endptr=newstartptr;