2adcf355a748cf468cf1bf5bffc502eb12c45c42
[ghc-hetmet.git] / ghc / rts / RtsUtils.h
1 /* -----------------------------------------------------------------------------
2  * $Id: RtsUtils.h,v 1.18 2003/09/26 12:11:18 panne Exp $
3  *
4  * (c) The GHC Team, 1998-1999
5  *
6  * General utility functions used in the RTS.
7  *
8  * ---------------------------------------------------------------------------*/
9
10 /* (Checked) dynamic allocation: */
11 extern void *stgMallocBytes(int n, char *msg);
12 extern void *stgReallocBytes(void *p, int n, char *msg);
13 extern void *stgCallocBytes(int n, int m, char *msg);
14 extern void stgFree(void* p);
15
16 extern void barf(char *s, ...) __attribute__((__noreturn__)) ;
17 extern void belch(char *s, ...);
18 extern void prog_belch(char *s, ...);
19
20 extern void _stgAssert (char *filename, unsigned int linenum);
21
22 extern void heapOverflow(void);
23
24 extern void setNonBlockingFd(int fd);
25 extern void resetNonBlockingFd(int fd);
26
27 extern nat stg_strlen(char *str);
28
29 /*Defined in Main.c, but made visible here*/
30 extern void stg_exit(int n) __attribute__((noreturn));
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);