#ifndef PMC_GARBAGE_H
#define PMC_GARBAGE_H
+#include <tmc/spin.h>
+
+#define NUMPMCUNITS (4*NUMCORES4GC)
+#define UNITSIZE (BAMBOO_SHARED_MEM_SIZE/NUMPMCUNITS)
+
struct pmc_unit {
- unsigned int lock;
+ tmc_spin_mutex_t lock;
unsigned int numbytes;
+ unsigned int regionnum;
+ void * endptr;
};
struct pmc_region {
+ void * allocptr;
void * lastptr;
+ void * startptr;
+ void * endptr;
+ tmc_spin_mutex_t lock;
struct ___Object___ * lastobj;
+ struct pmc_queue markqueue;
};
struct pmc_heap {
- struct pmc_region units[NUMCORES4GC*4];
+ struct pmc_region units[NUMPMCUNITS];
struct pmc_region regions[NUMCORES4GC];
- unsigned int lock;
- unsigned int numthreads;
+ tmc_spin_mutex_t lock;
+ volatile unsigned int numthreads;
};
extern struct pmc_heap * pmc_heapptr;
+extern struct pmc_queue * pmc_localqueue;
+void incrementthreads();
+void decrementthreads();
+void pmc_onceInit();
+void pmc_init();
+void gc(struct garbagelist *gl);
#endif