d0a33a428e6c99801d27dfb941f913214e699f43
[IRC.git] / Robust / src / Runtime / bamboo / pmc_garbage.h
1 #ifndef PMC_GARBAGE_H
2 #define PMC_GARBAGE_H
3 #include <tmc/spin.h>
4
5 #define NUMPMCUNITS (4*NUMCORES4GC)
6 #define UNITSIZE (BAMBOO_SHARED_MEM_SIZE/NUMPMCUNITS)
7
8 struct pmc_unit {
9   tmc_spin_mutex_t lock;
10   unsigned int numbytes;
11   unsigned int regionnum;
12 };
13
14 struct pmc_region {
15   void * lastptr;
16   struct ___Object___ * lastobj;
17   struct pmc_queue markqueue;
18 };
19
20 struct pmc_heap {
21   struct pmc_region units[NUMPMCUNITS];
22   struct pmc_region regions[NUMCORES4GC];
23   tmc_spin_mutex_t lock;
24   volatile unsigned int numthreads;
25 };
26
27 extern struct pmc_heap * pmc_heapptr;
28 extern struct pmc_queue * pmc_localqueue;
29
30 void incrementthreads();
31 void decrementthreads();
32 void pmc_onceInit();
33 void pmc_init();
34
35
36 #endif