+ unit->numbytes=totalbytes;
+}
+
+void pmc_processunits() {
+ unsigned int livebytes=0;
+ for(int i=0;i<NUMPMCUNITS;i++) {
+ livebytes+=pmc_heapptr->units[i].numbytes;
+ }
+ //make sure to round up
+ unsigned int livebytespercore=((livebytes-1)/NUMCORES4GC)+1;
+ unsigned int regionnum=0;
+ int totalbytes=0;
+ int numregions=0;
+
+ for(int i=0;i<NUMPMCUNITS;i++) {
+ if (numregions>0&&(totalbytes+pmc_heapptr->units[i].numbytes)>livebytespercore) {
+ regionnum++;
+ totalbytes-=livebytespercore;
+ numregions=0;
+ }
+ numregions++;
+ pmc_heapptr->units[i].regionnum=regionnum;
+ tmc_spin_mutex_init(&pmc_heapptr->units[i].lock);
+ totalbytes+=pmc_heapptr->units[i].numbytes;
+ }