for(int i=0;i<NUMPMCUNITS;i++) {
if (!tmc_spin_mutex_trylock(&pmc_heapptr->units[i].lock)) {
//got lock
- void *unitbase=(i==0)?gcbaseva:pmc_heapptr->units[i-1]->endptr;
- void *unittop=pmc_heapptr->units[i]->endptr;
+ void *unitbase=(i==0)?gcbaseva:pmc_heapptr->units[i-1].endptr;
+ void *unittop=pmc_heapptr->units[i].endptr;
pmc_countbytes(&pmc_heapptr->units[i], unitbase, unittop);
}
}
forwardptr=newforwardptr;
if (lastobj&&!fwddirection) {
- tmpptr->backward=lastobj;
+ ((struct ___Object___ *)tmpptr)->backward=lastobj;
lastobj=(struct ___Object___ *)tmpptr;
}
}
-#include "pmc_garbage.h"
#include "multicoregc.h"
-#inclued "runtime_arch.h"
+#include "pmc_garbage.h"
+#include "runtime_arch.h"
struct pmc_queue * pmc_localqueue;
}
void pmc_onceInit() {
- pmc_localqueue=&pmc_heapptr->regions[BAMBOO_NUM_OF_THREADS].markqueue;
+ pmc_localqueue=&pmc_heapptr->regions[BAMBOO_NUM_OF_CORE].markqueue;
pmc_queueinit(pmc_localqueue);
tmc_spin_barrier_init(&pmc_heapptr->barrier, NUMCORES4GC);
for(int i=0;i<NUMPMCUNITS;i++) {
}
void pmc_init() {
- if (BAMBOO_NUM_OF_THREADS==STARTUPCORE) {
+ if (BAMBOO_NUM_OF_CORE==STARTUPCORE) {
pmc_heapptr->numthreads=NUMCORES4GC;
}
tmc_spin_barrier_wait(&pmc_heapptr->barrier);
pmc_count();
tmc_spin_barrier_wait(&pmc_heapptr->barrier);
//divide up work
- if (BAMBOO_NUM_OF_THREADS==STARTUPCORE) {
+ if (BAMBOO_NUM_OF_CORE==STARTUPCORE) {
pmc_processunits();
}
tmc_spin_barrier_wait(&pmc_heapptr->barrier);
#include "pmc_garbage.h"
#include "multicoremgc.h"
#include <stdlib.h>
+#include "runtime.h"
+#include "thread.h"
#define PMC_MARKOBJ(objptr) {void * marktmpptr=objptr; if (marktmpptr!=NULL) {pmc_markObj(marktmpptr);}}
+#include <stdlib.h>
#include "pmc_garbage.h"
#include "pmc_mem.h"
if ((finishptr-startptr)<memcheck)
break;
unsigned int startindex=region->lowunit;
- unsigned int endindex=pmc_heapptr->regions[i+1]->highunit;
+ unsigned int endindex=pmc_heapptr->regions[i+1].highunit;
void * newstartptr=startptr+memcheck;
//update unit end points
#include <stdlib.h>
#include "structdefs.h"
+#include "bambooalign.h"
+#include "runtime_arch.h"
#include "pmc_forward.h"
#include "pmc_refupdate.h"
tmpptr+=size;
}
} else {
- struct ___Object___ *backward=region->lastobj;
+ struct ___Object___ *backward=((struct ___Object___ *) region)->backward;
struct ___Object___ *lastobj=NULL;
while(backward) {
lastobj=backward;
- backward=backward->lastobj;
+ backward=backward->backward;
unsigned int type;
unsigned int size;
- gettype_size(tmpptr, &type, &size);
+ gettype_size(lastobj, &type, &size);
void *forwardptr=(void *)((struct ___Object___ *) lastobj)->marked;
((struct ___Object___ *) lastobj)->marked=NULL;
if (forwardptr) {