Code clean. Change BAMBOO_EXIT macro to print out file name and line #
[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 numblocks;       // block num for heap
9   unsigned int base;       // base virtual address of current heap block
10   unsigned int ptr;       // virtual address of current heap top
11   unsigned int offset;       // offset in current heap block
12   unsigned int blockbase;   // virtual address of current small block to check
13   unsigned int blockbound;     // bound virtual address of current small blcok
14   unsigned int sblockindex;       // index of the small blocks
15   unsigned int top;       // real size of current heap block to check
16   unsigned int bound;       // bound size of current heap block to check
17 };
18
19 // compute the remaining size of block #b
20 // p--relative position to the bottom of the shared heap
21 #define GC_BLOCK_REMAIN_SIZE(b, p) \
22   ((b)<NUMCORES4GC)?((BAMBOO_SMEM_SIZE_L)-((p)%(BAMBOO_SMEM_SIZE_L))):((BAMBOO_SMEM_SIZE)-((p)%(BAMBOO_SMEM_SIZE)))
23
24 bool gcfindSpareMem_I(unsigned int * startaddr,
25                       unsigned int * tomove,
26                       unsigned int * dstcore,
27                       unsigned int requiredmem,
28                       unsigned int requiredcore);
29 void compact();
30 void compact_master(struct moveHelper * orig, struct moveHelper * to);
31 #endif // MULTICORE_GC
32
33 #endif // BAMBOO_MULTICORE_GC_COMPACT_H