1 /* -----------------------------------------------------------------------------
2 * $Id: StoragePriv.h,v 1.14 2001/01/24 15:39:50 simonmar Exp $
4 * (c) The GHC Team, 1998-1999
6 * Internal Storage Manger Interface
8 * ---------------------------------------------------------------------------*/
13 #define END_OF_STATIC_LIST stgCast(StgClosure*,1)
15 extern generation *generations;
17 extern generation *g0;
19 extern generation *oldest_gen;
21 extern void newCAF(StgClosure*);
22 extern StgTSO *relocate_TSO(StgTSO *src, StgTSO *dest);
24 extern StgWeak *weak_ptr_list;
25 extern StgClosure *caf_list;
27 extern bdescr *small_alloc_list;
28 extern bdescr *large_alloc_list;
30 extern StgPtr alloc_Hp;
31 extern StgPtr alloc_HpLim;
33 extern bdescr *nursery;
35 extern nat nursery_blocks;
36 extern nat alloc_blocks;
37 extern nat alloc_blocks_lim;
39 extern lnat total_allocated;
41 /* Nursery manipulation */
42 extern void allocNurseries ( void );
43 extern void resetNurseries ( void );
44 extern bdescr * allocNursery ( bdescr *last_bd, nat blocks );
45 extern void resizeNursery ( nat blocks );
48 extern lnat calcAllocated ( void );
49 extern lnat calcLive ( void );
50 extern lnat calcNeeded ( void );
53 dbl_link_onto(bdescr *bd, bdescr **list)
58 (*list)->back = bd; /* double-link the list */
64 * A mutable list is ended with END_MUT_LIST, so that we can use NULL
65 * as an indication that an object is not on a mutable list.
67 #define END_MUT_LIST ((StgMutClosure *)(void *)&stg_END_MUT_LIST_closure)
70 extern void memInventory(void);
71 extern void checkSanity(nat N);
75 * These three are used by the garbage collector when we have
76 * dynamically-linked object modules. (see ClosureMacros.h,
78 * Defined in Linker.c.
80 int is_dynamically_loaded_code_or_rodata_ptr ( void* p );
81 int is_dynamically_loaded_rwdata_ptr ( void* p );
82 int is_not_dynamically_loaded_ptr ( void* p );
84 #endif /* STORAGEPRIV_H */