Fix unwinding of C -> Haskell FFI calls with -threaded (2nd try)
[ghc.git] / rts / RtsUtils.h
1 /* -----------------------------------------------------------------------------
2 *
3 * (c) The GHC Team, 1998-2009
4 *
5 * General utility functions used in the RTS.
6 *
7 * ---------------------------------------------------------------------------*/
8
9 #pragma once
10
11 #include "BeginPrivate.h"
12
13 /* -----------------------------------------------------------------------------
14 * (Checked) dynamic allocation
15 * -------------------------------------------------------------------------- */
16
17 void initAllocator(void);
18 void shutdownAllocator(void);
19
20 void *stgMallocBytes(size_t n, char *msg)
21 GNUC3_ATTRIBUTE(__malloc__);
22
23 void *stgReallocBytes(void *p, size_t n, char *msg);
24
25 void *stgCallocBytes(size_t n, size_t m, char *msg)
26 GNUC3_ATTRIBUTE(__malloc__);
27
28 char *stgStrndup(const char *s, size_t n);
29
30 void stgFree(void* p);
31
32 /* -----------------------------------------------------------------------------
33 * Misc other utilities
34 * -------------------------------------------------------------------------- */
35
36 char *time_str(void);
37 char *showStgWord64(StgWord64, char *, bool);
38
39 #if defined(DEBUG)
40 void heapCheckFail( void );
41 #endif
42
43 void printRtsInfo(void);
44
45 void checkFPUStack(void);
46
47 #define xstr(s) str(s)
48 #define str(s) #s
49
50 #include "EndPrivate.h"