[project @ 2004-08-13 13:04:50 by simonmar]
[ghc-hetmet.git] / ghc / rts / RtsUtils.h
1 /* -----------------------------------------------------------------------------
2  *
3  * (c) The GHC Team, 1998-2004
4  *
5  * General utility functions used in the RTS.
6  *
7  * ---------------------------------------------------------------------------*/
8
9 #ifndef RTSUTILS_H
10 #define RTSUTILS_H
11
12 /* (Checked) dynamic allocation: */
13 extern void *stgMallocBytes(int n, char *msg) GNUC3_ATTRIBUTE(__malloc__);
14 extern void *stgReallocBytes(void *p, int n, char *msg);
15 extern void *stgCallocBytes(int n, int m, char *msg) GNUC3_ATTRIBUTE(__malloc__);
16 extern void stgFree(void* p);
17
18 extern void barf(char *s, ...) GNU_ATTRIBUTE(__noreturn__);
19 extern void belch(char *s, ...);
20 extern void prog_belch(char *s, ...);
21
22 extern void _stgAssert (char *filename, unsigned int linenum);
23
24 extern void heapOverflow(void);
25
26 extern void setNonBlockingFd(int fd);
27 extern void resetNonBlockingFd(int fd);
28
29 extern nat stg_strlen(char *str);
30
31 char *time_str(void);
32 char *ullong_format_string(ullong, char *, rtsBool);
33
34 #ifdef PAR
35 ullong   msTime(void);
36 #endif
37
38 #ifdef DEBUG
39 extern void heapCheckFail( void );
40 #endif
41
42 extern void* __hscore_get_saved_termios(int fd);
43 extern void __hscore_set_saved_termios(int fd, void* ts);
44
45 #endif // RTSUTILS_H