Adding TcGadt.lhs
[ghc-hetmet.git] / rts / RtsUtils.h
1 /* -----------------------------------------------------------------------------
2  *
3  * (c) The GHC Team, 1998-2005
4  *
5  * General utility functions used in the RTS.
6  *
7  * ---------------------------------------------------------------------------*/
8
9 #ifndef RTSUTILS_H
10 #define RTSUTILS_H
11
12 /* -----------------------------------------------------------------------------
13  * (Checked) dynamic allocation
14  * -------------------------------------------------------------------------- */
15
16 extern void *stgMallocBytes(int n, char *msg)
17     GNUC3_ATTRIBUTE(__malloc__);
18
19 extern void *stgReallocBytes(void *p, int n, char *msg);
20
21 extern void *stgCallocBytes(int n, int m, char *msg)
22      GNUC3_ATTRIBUTE(__malloc__);
23
24 extern void stgFree(void* p);
25
26 /* -----------------------------------------------------------------------------
27  * Misc other utilities
28  * -------------------------------------------------------------------------- */
29
30 extern void heapOverflow(void);
31
32 extern void setNonBlockingFd(int fd);
33 extern void resetNonBlockingFd(int fd);
34
35 extern nat stg_strlen(char *str);
36
37 extern char *time_str(void);
38 extern char *ullong_format_string(ullong, char *, rtsBool);
39
40 #ifdef PAR
41 extern ullong msTime(void);
42 #endif
43
44 #ifdef DEBUG
45 extern void heapCheckFail( void );
46 #endif
47
48 extern void* __hscore_get_saved_termios(int fd);
49 extern void __hscore_set_saved_termios(int fd, void* ts);
50
51 #endif /* RTSUTILS_H */