[project @ 1998-11-26 09:17:22 by sof]
[ghc-hetmet.git] / ghc / runtime / storage / SMinit.lc
1 \section[storage-manager-init]{Initialising the storage manager}
2
3 To initialise the storage manager, we pass it:
4 \begin{itemize}
5 \item
6 An @argc@/@argv@ combo, which are the command-line arguments that have
7 been deemed to belong to the runtime system.  The initialisation
8 routine can slurp around in there for information of interest to
9 it.
10
11 \item
12 A filehandle to which any storage-manager statistics should be written.
13 \end{itemize}
14
15 \begin{code}
16 #define NULL_REG_MAP
17 #include "SMinternal.h"
18 \end{code}
19
20 \section[storage-manager-exit]{Winding up the storage manager}
21
22 \begin{code}
23 rtsBool
24 exitSM (smInfo *sm_info)
25 {
26 #ifndef PAR
27     int rc;
28      /* Upon closing down the storage manager, we free all foreign objects 
29         (in new *and* old generations) 
30      */
31     rc = freeForeigns(sm_info->ForeignObjList);
32 # if defined(GCap) || defined(GCgn)
33     rc = freeForeigns(sm_info->OldForeignObjList);
34 # endif
35
36 #endif
37      /* Return code ignored for now */
38     stat_exit(sm_info->hp - hp_start);
39
40     return rtsTrue; /* I'm happy */
41 }
42 \end{code}