X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fincludes%2FSMinterface.lh;h=4fb03e6d948610337291ca94551c0c2db2b269d2;hb=9065404aff7fea3b996e014da4c2f6a1604a0fb0;hp=0622d4decf8b8496dec4a665b36b6dd1a34f4461;hpb=e7d21ee4f8ac907665a7e170c71d59e13a01da09;p=ghc-hetmet.git diff --git a/ghc/includes/SMinterface.lh b/ghc/includes/SMinterface.lh index 0622d4d..4fb03e6 100644 --- a/ghc/includes/SMinterface.lh +++ b/ghc/includes/SMinterface.lh @@ -54,10 +54,10 @@ typedef struct { #endif #ifndef PAR - P_ MallocPtrList; /* List of all Malloc Pointers (in new generation) */ + P_ ForeignObjList; /* List of all Foreign objects (in new generation) */ #if defined(GCap) || defined(GCgn) - P_ OldMallocPtrList; /* List of all Malloc Pointers in old generation */ + P_ OldForeignObjList; /* List of all Foreign objects in old generation */ #endif P_ StablePointerTable; @@ -78,15 +78,14 @@ Question: Where are the stable pointer roots? (JSM) Answer: They're on the heap in a "Stable Pointer Table". (ADR) \begin{code} #ifndef CONCURRENT -# define SM_MAXROOTS 8 /* 8 Vanilla Regs */ +# define SM_MAXROOTS 9 /* 8 Vanilla Regs + stable pointer table*/ #else # ifndef PAR # ifdef GRAN -# define SM_MAXROOTS (10 + (MAX_PROC*4) + 2 + (MAX_PROC*2) + MAX_SPARKS) - /* unthreaded + spark/thread queues + Current/Main TSOs - + events + sparks */ +# define SM_MAXROOTS (10 + (MAX_PROC*2) + 2 ) + /* unthreaded + hd/tl thread queues + Current/Main TSOs */ # else -# define SM_MAXROOTS 5 /* See c-as-asm/HpOverflow.lc */ +# define SM_MAXROOTS 6 /* See c-as-asm/HpOverflow.lc */ # endif # else # define SM_MAXROOTS 6 /* See c-as-asm/HpOverflow.lc */ @@ -96,22 +95,22 @@ Answer: They're on the heap in a "Stable Pointer Table". (ADR) The storage manager is accessed exclusively through these routines: \begin{code} -IF_RTS(I_ initSM PROTO((I_ rts_argc, char **rts_argv, FILE *statsfile));) -IF_RTS(I_ exitSM PROTO((smInfo *sm));) -IF_RTS(I_ initStacks PROTO((smInfo *sm));) -IF_RTS(I_ initHeap PROTO((smInfo *sm));) +IF_RTS(void initSM (STG_NO_ARGS);) +IF_RTS(rtsBool exitSM PROTO((smInfo *sm));) +IF_RTS(rtsBool initStacks PROTO((smInfo *sm));) +IF_RTS(rtsBool initHeap PROTO((smInfo *sm));) #ifdef CONCURRENT -IF_RTS(rtsBool initThreadPool PROTO((I_ size));) +IF_RTS(rtsBool initThreadPools (STG_NO_ARGS);) #endif #ifdef PAR IF_RTS(void init_gr_profiling PROTO((int, char **, int, char **));) #endif -I_ collectHeap PROTO((W_ reqsize, smInfo *sm, rtsBool do_full_collection)); +I_ collectHeap PROTO((W_ reqsize, smInfo *sm, rtsBool do_full_collection)); IF_RTS(void unmapMiddleStackPage PROTO((char *, int));) /* char * == caddr_t ? */ -#if defined(USE_COST_CENTRES) || defined(GUM) +#if defined(PROFILING) || defined(PAR) IF_RTS(void handle_tick_serial(STG_NO_ARGS);) IF_RTS(void handle_tick_noserial(STG_NO_ARGS);) #endif @@ -125,15 +124,11 @@ void end_init(STG_NO_ARGS); #ifdef PAR void EvacuateLocalGAs PROTO((rtsBool full)); -void RebuildGAtables PROTO((rtsBool full)); +void RebuildGAtables PROTO((rtsBool full)); #endif - \end{code} -@initSM@ processes any runtime parameters directed towards the storage -manager. The @statsfile@ parameter is an open file, which will contain -any garbage collection statistics requested by the user. This file -must be opened for writing. +@initSM@ finalizes any runtime parameters of the storage manager. @exitSM@ does any cleaning up required by the storage manager before the program is executed. Its main purpose is to print any summary @@ -153,7 +148,7 @@ roots. If we are using Appel's collector it also initialises the @OldLim@ field. In the sequential system, it also initialises the stable pointer table -and the @MallocPtr@ (and @OldMallocPtrList@) fields. +and the @ForeignObjList@ (and @OldForeignObjList@) fields. @collectHeap@ invokes the garbage collector that was requested at compile time. @reqsize@ is the size of the request (in words) that @@ -200,9 +195,9 @@ B stack arising from any update frame ``squeezing'' [sequential only]. \item The elements of @CAFlist@ and the stable pointers will be updated to point to the new locations of the closures they reference. -\item Any members of @MallocPtrList@ which became garbage should have -been reported (by calling @FreeMallocPtr@; and the @(Old)MallocPtrList@ -updated to contain only those Malloc Pointers which are still live. +\item Any members of @ForeignObjList@ which became garbage should have +been reported (by calling their finalising routines; and the @(Old)ForeignObjList@ +updated to contain only those Foreign objects which are still live. \end{itemize} \end{description} @@ -436,6 +431,7 @@ same, but without the saved SuA pointer. We store the following information concerning the stacks in a global structure. (sequential only). \begin{code} +#if 1 /* ndef CONCURRENT * /? HWL */ typedef struct { PP_ botA; /* Points to bottom-most word of A stack */ @@ -443,6 +439,8 @@ typedef struct { } stackData; extern stackData stackInfo; + +#endif /* !CONCURRENT */ \end{code} %************************************************************************ @@ -455,22 +453,21 @@ Each garbage collector requires different garbage collection entries in the info-table. \begin{code} -#if defined(GC2s) -#define _INFO_COPYING -#else -#if defined(GC1s) +#if defined(GCdu) || defined (GCap) || defined (GCgn) +#define _INFO_COPYING #define _INFO_COMPACTING #define _INFO_MARKING - #else -#if defined(GCdu) || defined (GCap) || defined (GCgn) +#if defined(GC2s) #define _INFO_COPYING + +#else +#if defined(GC1s) #define _INFO_COMPACTING #define _INFO_MARKING - #else -/* NO_INFO_SPECIFIED (ToDo: an #error ???) */ +/* NO_INFO_SPECIFIED (ToDo: an #error ?) */ #endif #endif #endif