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