X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Frts%2FStoragePriv.h;h=678370b35d35958e4d0ba6d4f7c297bc02895e2a;hb=daa4d18454157f664a0ff333bb592bb0bd6b4edc;hp=033b06cf4242cecfd0e0473d8712d8eedf0f8e42;hpb=0671ef05dd65137d501cb97f0e42be3b78d4004d;p=ghc-hetmet.git diff --git a/ghc/rts/StoragePriv.h b/ghc/rts/StoragePriv.h index 033b06c..678370b 100644 --- a/ghc/rts/StoragePriv.h +++ b/ghc/rts/StoragePriv.h @@ -1,98 +1,24 @@ /* ----------------------------------------------------------------------------- - * $Id: StoragePriv.h,v 1.19 2001/11/08 12:46:31 simonmar Exp $ * - * (c) The GHC Team, 1998-1999 + * (c) The GHC Team, 1998-2005 * - * Internal Storage Manger Interface + * Storage manager bits visible to the rest of the RTS only * * ---------------------------------------------------------------------------*/ #ifndef STORAGEPRIV_H #define STORAGEPRIV_H -#include - -#define END_OF_STATIC_LIST stgCast(StgClosure*,1) - -extern generation *generations; - -extern generation *g0; -extern step *g0s0; -extern generation *oldest_gen; - -extern void newCAF(StgClosure*); - -extern void move_TSO(StgTSO *src, StgTSO *dest); -extern StgTSO *relocate_stack(StgTSO *dest, ptrdiff_t diff); - -extern StgClosure *static_objects; -extern StgClosure *scavenged_static_objects; - -extern StgWeak *weak_ptr_list; -extern StgClosure *caf_list; - -extern bdescr *small_alloc_list; -extern bdescr *large_alloc_list; -extern bdescr *pinned_object_block; - -extern StgPtr alloc_Hp; -extern StgPtr alloc_HpLim; - -extern bdescr *nursery; - -extern nat alloc_blocks; -extern nat alloc_blocks_lim; - -extern lnat total_allocated; - -/* Nursery manipulation */ -extern void allocNurseries ( void ); -extern void resetNurseries ( void ); -extern bdescr * allocNursery ( bdescr *last_bd, nat blocks ); -extern void resizeNursery ( nat blocks ); - -/* Stats 'n' stuff */ -extern lnat calcAllocated ( void ); -extern lnat calcLive ( void ); -extern lnat calcNeeded ( void ); - -static inline void -dbl_link_onto(bdescr *bd, bdescr **list) -{ - bd->link = *list; - bd->u.back = NULL; - if (*list) { - (*list)->u.back = bd; /* double-link the list */ - } - *list = bd; -} - -/* MUTABLE LISTS - * A mutable list is ended with END_MUT_LIST, so that we can use NULL - * as an indication that an object is not on a mutable list. +/* + * Storage manager mutex */ -#define END_MUT_LIST ((StgMutClosure *)(void *)&stg_END_MUT_LIST_closure) - -#ifdef DEBUG -extern void memInventory(void); -extern void checkSanity(void); -extern nat countBlocks(bdescr *); +#if defined(SMP) +extern Mutex sm_mutex; +#define ACQUIRE_SM_LOCK ACQUIRE_LOCK(&sm_mutex) +#define RELEASE_SM_LOCK RELEASE_LOCK(&sm_mutex) +#else +#define ACQUIRE_SM_LOCK +#define RELEASE_SM_LOCK #endif -/* - * These three are used by the garbage collector when we have - * dynamically-linked object modules. (see ClosureMacros.h, - * IS_CODE_PTR etc.). - * Defined in Linker.c. - */ -int is_dynamically_loaded_code_or_rodata_ptr ( void* p ); -int is_dynamically_loaded_rwdata_ptr ( void* p ); -int is_not_dynamically_loaded_ptr ( void* p ); - -/* Functions from GC.c - */ -extern void threadPaused ( StgTSO * ); -extern StgClosure * isAlive ( StgClosure *p ); -extern void markCAFs ( evac_fn evac ); - #endif /* STORAGEPRIV_H */