1 /* ----------------------------------------------------------------------------
3 * (c) The GHC Team 1998-2006
5 * Generational garbage collector: utilities
7 * Documentation on the architecture of the Garbage Collector can be
8 * found in the online commentary:
10 * http://hackage.haskell.org/trac/ghc/wiki/Commentary/Rts/Storage/GC
12 * --------------------------------------------------------------------------*/
17 extern SpinLock gc_alloc_block_sync;
20 bdescr *allocBlock_sync(void);
21 void freeChain_sync(bdescr *bd);
23 void push_scan_block (bdescr *bd, step_workspace *ws);
24 bdescr *grab_todo_block (step_workspace *ws);
25 StgPtr gc_alloc_todo_block (step_workspace *ws);
26 bdescr *gc_alloc_scavd_block (step_workspace *ws);
28 // Returns true if a block is 3/4 full. This predicate is used to try
29 // to re-use partial blocks wherever possible, and to reduce wastage.
30 // We might need to tweak the actual value.
32 isPartiallyFull(bdescr *bd)
34 return (bd->free + BLOCK_SIZE_W/4 < bd->start + BLOCK_SIZE_W);
39 void printMutableList (generation *gen);