1 /* -----------------------------------------------------------------------------
2 * $Id: Stg.h,v 1.13 1999/06/25 09:13:38 simonmar Exp $
4 * (c) The GHC Team, 1998-1999
6 * Top-level include file for everything STG-ish.
8 * This file is included *automatically* by all .hc files.
10 * ---------------------------------------------------------------------------*/
15 #ifndef NON_POSIX_SOURCE
21 #ifdef __HUGS__ /* vile hack till the GHC folks come on board */
25 /* Some macros to handle DLLing (Win32 only at the moment). */
28 /* Turn lazy blackholing and eager blackholing on/off.
30 * Using eager blackholing makes things easier to debug because
31 * the blackholes are more predictable - but it's slower and less sexy.
33 * For now, do lazy and not eager.
36 #define LAZY_BLACKHOLING
37 /* #define EAGER_BLACKHOLING */
40 /* TICKY_TICKY needs EAGER_BLACKHOLING to verify no double-entries of single-entry thunks. */
41 # undef LAZY_BLACKHOLING
42 # define EAGER_BLACKHOLING
45 /* ToDo: Set this flag properly: COMPILER and INTERPRETER should not be mutually exclusive. */
50 #ifndef USE_MINIINTERPRETER
51 #define TABLES_NEXT_TO_CODE
56 #define BITS_PER_BYTE 8
57 #define BITS_IN(x) (BITS_PER_BYTE * sizeof(x))
59 /* -----------------------------------------------------------------------------
60 Assertions and Debuggery
61 -------------------------------------------------------------------------- */
64 #define ASSERT(predicate) /* nothing */
67 void _stgAssert (char *, unsigned int);
69 #define ASSERT(predicate) \
73 _stgAssert(__FILE__, __LINE__)
76 /* -----------------------------------------------------------------------------
77 Include everything STG-ish
78 -------------------------------------------------------------------------- */
80 /* Global type definitions*/
83 /* Global constaints */
84 #include "Constants.h"
86 /* Profiling information */
87 #include "Profiling.h"
89 /* Storage format definitions */
91 #include "ClosureTypes.h"
92 #include "InfoTables.h"
95 /* STG/Optimised-C related stuff */
98 #include "TailCalls.h"
100 /* these are all ANSI C headers */
119 /* Wired-in Prelude identifiers */
122 /* Storage Manager */
123 #include "StgStorage.h"
125 /* Macros for STG/C code */
126 #include "ClosureMacros.h"
127 #include "InfoMacros.h"
128 #include "StgMacros.h"
132 #include "StgTicky.h"
136 /* Built-in entry points */
137 #include "StgMiscClosures.h"
139 /* Runtime-system hooks */
142 /* Misc stuff without a home */
143 #if defined(ENABLE_WIN32_DLL_SUPPOT) && !defined(COMPILING_RTS)
144 extern DLLIMPORT char **prog_argv; /* so we can get at these from Haskell */
145 extern DLLIMPORT int prog_argc;
147 extern char **prog_argv; /* so we can get at these from Haskell */
148 extern int prog_argc;
151 extern char **environ;
153 /* Creating and destroying an adjustor thunk.
154 I cannot make myself create a separate .h file
158 extern void* createAdjustor(int cconv, StgStablePtr hptr, StgFunPtr wptr);
159 extern void freeHaskellFunctionPtr(void* ptr);