more odd core count bugs
authorbdemsky <bdemsky>
Sat, 16 Jul 2011 00:02:46 +0000 (00:02 +0000)
committerbdemsky <bdemsky>
Sat, 16 Jul 2011 00:02:46 +0000 (00:02 +0000)
Robust/src/Runtime/bamboo/pmc_forward.c
Robust/src/Runtime/bamboo/pmc_garbage.c

index d886b552f13d3a93f03d4f898882f5a3cb60c536..c60d7ce5c4060770d4893c89559eaaaedf316910 100644 (file)
@@ -86,8 +86,10 @@ void pmc_processunits() {
   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;
+    }
   }
 }
 
index 3a9f99dc7e75a3a21e5a79e0f01c2540ff785486..8933bcda0d970577a79db79180180bc642b12e3b 100644 (file)
@@ -66,7 +66,7 @@ void pmc_init() {
       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;