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