Add cache adaptive code to multicore gc and add support for System.gc()
[IRC.git] / Robust / src / Runtime / bamboo / multicoregccompact.h
1 #ifndef BAMBOO_MULTICORE_GC_COMPACT_H
2 #define BAMBOO_MULTICORE_GC_COMPACT_H
3
4 #ifdef MULTICORE_GC
5 #include "multicore.h"
6
7 struct moveHelper {
8   unsigned int localblocknum;   // local block num for heap
9   void * base;             // base virtual address of current heap block
10   void * ptr;              // current pointer into block
11   void * bound;            // upper bound of current block
12 #ifdef GC_CACHE_ADAPT
13   void * pagebound;        // upper bound of current available page
14 #endif
15 };
16
17 void initOrig_Dst(struct moveHelper * orig,struct moveHelper * to);
18 void compacthelper(struct moveHelper * orig,struct moveHelper * to);
19 void compact();
20 void compact_master(struct moveHelper * orig, struct moveHelper * to);
21 #ifdef GC_CACHE_ADAPT
22 unsigned int compactpages(struct moveHelper * orig,struct moveHelper * to);
23 #define COMPACTUNITS(o,t) compactpages((o), (t))
24 #else
25 unsigned int compactblocks(struct moveHelper * orig,struct moveHelper * to);
26 #define COMPACTUNITS(o,t) compactblocks((o), (t))
27 #endif
28 #endif // MULTICORE_GC
29
30 #endif // BAMBOO_MULTICORE_GC_COMPACT_H