1 /* -----------------------------------------------------------------------------
2 * $Id: StoragePriv.h,v 1.15 2001/07/23 17:23:20 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*);
23 extern void move_TSO(StgTSO *src, StgTSO *dest);
24 extern StgTSO *relocate_stack(StgTSO *dest, int diff);
26 extern StgClosure *static_objects;
27 extern StgClosure *scavenged_static_objects;
29 extern StgWeak *weak_ptr_list;
30 extern StgClosure *caf_list;
32 extern bdescr *small_alloc_list;
33 extern bdescr *large_alloc_list;
35 extern StgPtr alloc_Hp;
36 extern StgPtr alloc_HpLim;
38 extern bdescr *nursery;
40 extern nat nursery_blocks;
41 extern nat alloc_blocks;
42 extern nat alloc_blocks_lim;
44 extern lnat total_allocated;
46 /* Nursery manipulation */
47 extern void allocNurseries ( void );
48 extern void resetNurseries ( void );
49 extern bdescr * allocNursery ( bdescr *last_bd, nat blocks );
50 extern void resizeNursery ( nat blocks );
53 extern lnat calcAllocated ( void );
54 extern lnat calcLive ( void );
55 extern lnat calcNeeded ( void );
58 dbl_link_onto(bdescr *bd, bdescr **list)
63 (*list)->u.back = bd; /* double-link the list */
69 * A mutable list is ended with END_MUT_LIST, so that we can use NULL
70 * as an indication that an object is not on a mutable list.
72 #define END_MUT_LIST ((StgMutClosure *)(void *)&stg_END_MUT_LIST_closure)
75 extern void memInventory(void);
76 extern void checkSanity(void);
80 * These three are used by the garbage collector when we have
81 * dynamically-linked object modules. (see ClosureMacros.h,
83 * Defined in Linker.c.
85 int is_dynamically_loaded_code_or_rodata_ptr ( void* p );
86 int is_dynamically_loaded_rwdata_ptr ( void* p );
87 int is_not_dynamically_loaded_ptr ( void* p );
89 /* Functions from GC.c
91 void threadPaused(StgTSO *);
92 StgClosure *isAlive(StgClosure *p);
94 #endif /* STORAGEPRIV_H */