X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Frts%2FStoragePriv.h;h=c829e7894437e8070e6f6d64860d0ad6613c0f27;hb=553e90d9a32ee1b1809430f260c401cc4169c6c7;hp=c3054a501e3de77ddf2ac27b88a60292baf9e62e;hpb=438596897ebbe25a07e1c82085cfbc5bdb00f09e;p=ghc-hetmet.git diff --git a/ghc/rts/StoragePriv.h b/ghc/rts/StoragePriv.h index c3054a5..c829e78 100644 --- a/ghc/rts/StoragePriv.h +++ b/ghc/rts/StoragePriv.h @@ -1,26 +1,94 @@ /* ----------------------------------------------------------------------------- - * $Id: StoragePriv.h,v 1.2 1998/12/02 13:28:59 simonm Exp $ + * $Id: StoragePriv.h,v 1.26 2004/07/21 10:47:29 simonmar Exp $ + * + * (c) The GHC Team, 1998-1999 * * Internal Storage Manger Interface * * ---------------------------------------------------------------------------*/ -extern bdescr *allocNursery (bdescr *last_bd, nat blocks); +#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 StgTSO *relocate_TSO(StgTSO *src, StgTSO *dest); +extern void newDynCAF(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 *old_weak_ptr_list; extern StgWeak *weak_ptr_list; extern StgClosure *caf_list; +extern StgTSO *resurrected_threads; + 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 nursery_blocks; extern nat alloc_blocks; extern nat alloc_blocks_lim; +extern ullong 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 ); +extern void tidyAllocateLists ( void ); + +/* Stats 'n' stuff */ +extern lnat calcAllocated ( void ); +extern lnat calcLive ( void ); +extern lnat calcNeeded ( void ); + +INLINE_HEADER 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. + */ +#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 *); +#endif + +/* Functions from GC.c + */ +extern void threadPaused ( StgTSO * ); +extern StgClosure * isAlive ( StgClosure *p ); +extern void markCAFs ( evac_fn evac ); + +#endif /* STORAGEPRIV_H */