1 /* -----------------------------------------------------------------------------
2 * $Id: Stg.h,v 1.12 1999/05/11 16:46:20 keithw 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. */
52 #define BITS_PER_BYTE 8
53 #define BITS_IN(x) (BITS_PER_BYTE * sizeof(x))
55 /* -----------------------------------------------------------------------------
56 Assertions and Debuggery
57 -------------------------------------------------------------------------- */
60 #define ASSERT(predicate) /* nothing */
63 void _stgAssert (char *, unsigned int);
65 #define ASSERT(predicate) \
69 _stgAssert(__FILE__, __LINE__)
72 /* -----------------------------------------------------------------------------
73 Include everything STG-ish
74 -------------------------------------------------------------------------- */
76 /* Global type definitions*/
79 /* Global constaints */
80 #include "Constants.h"
82 /* Profiling information */
83 #include "Profiling.h"
85 /* Storage format definitions */
87 #include "ClosureTypes.h"
88 #include "InfoTables.h"
91 /* STG/Optimised-C related stuff */
94 #include "TailCalls.h"
96 /* these are all ANSI C headers */
115 /* Wired-in Prelude identifiers */
118 /* Storage Manager */
119 #include "StgStorage.h"
121 /* Macros for STG/C code */
122 #include "ClosureMacros.h"
123 #include "InfoMacros.h"
124 #include "StgMacros.h"
128 #include "StgTicky.h"
132 /* Built-in entry points */
133 #include "StgMiscClosures.h"
135 /* Runtime-system hooks */
138 /* Misc stuff without a home */
139 #if defined(ENABLE_WIN32_DLL_SUPPOT) && !defined(COMPILING_RTS)
140 extern DLLIMPORT char **prog_argv; /* so we can get at these from Haskell */
141 extern DLLIMPORT int prog_argc;
143 extern char **prog_argv; /* so we can get at these from Haskell */
144 extern int prog_argc;
147 extern char **environ;
149 /* Creating and destroying an adjustor thunk.
150 I cannot make myself create a separate .h file
154 extern void* createAdjustor(int cconv, StgStablePtr hptr, StgFunPtr wptr);
155 extern void freeHaskellFunctionPtr(void* ptr);