more changes
[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   void * endptr;
13 };
14
15 struct pmc_region {
16   void * allocptr;
17   void * lastptr;
18   void * startptr;
19   void * endptr;
20   tmc_spin_mutex_t lock;
21   struct ___Object___ * lastobj;
22   struct pmc_queue markqueue;
23 };
24
25 struct pmc_heap {
26   struct pmc_region units[NUMPMCUNITS];
27   struct pmc_region regions[NUMCORES4GC];
28   tmc_spin_mutex_t lock;
29   volatile unsigned int numthreads;
30 };
31
32 extern struct pmc_heap * pmc_heapptr;
33 extern struct pmc_queue * pmc_localqueue;
34
35 void incrementthreads();
36 void decrementthreads();
37 void pmc_onceInit();
38 void pmc_init();
39 void gc(struct garbagelist *gl);
40 #endif