for(;regionnum<NUMCORES4GC;regionnum++) {
pmc_heapptr->regions[regionnum].highunit=NUMPMCUNITS;
pmc_heapptr->regions[regionnum].endptr=pmc_heapptr->units[NUMPMCUNITS-1].endptr;
- pmc_heapptr->regions[regionnum+1].startptr=pmc_heapptr->units[NUMPMCUNITS-1].endptr;
- pmc_heapptr->regions[regionnum+1].lowunit=NUMPMCUNITS;
+ if ((regionnum+1)<NUMCORES4GC) {
+ pmc_heapptr->regions[regionnum+1].startptr=pmc_heapptr->units[NUMPMCUNITS-1].endptr;
+ pmc_heapptr->regions[regionnum+1].lowunit=NUMPMCUNITS;
+ }
}
}
void *finishptr=(i+1)<NUMCORES4GC?pmc_heapptr->regions[i+1].lastptr:pmc_heapptr->regions[i].endptr;
struct pmc_region *region=&pmc_heapptr->regions[i];
unsigned int startindex=region->lowunit;
- unsigned int endindex=pmc_heapptr->regions[i+1].highunit;
+ unsigned int endindex=(i+1)<NUMCORES4GC?pmc_heapptr->regions[i+1].highunit:pmc_heapptr->regions[i].highunit;
//tprintf("Free space in partition %u from %x to %x\n", i, startptr, finishptr);
for(unsigned int index=startindex;index<endindex;index++) {
void *ptr=pmc_heapptr->units[index].endptr;