[project @ 2003-03-25 17:58:47 by sof]
[ghc-hetmet.git] / ghc / rts / RtsUtils.h
1 /* -----------------------------------------------------------------------------
2  * $Id: RtsUtils.h,v 1.15 2003/03/25 17:58:50 sof Exp $
3  *
4  * (c) The GHC Team, 1998-1999
5  *
6  * General utility functions used in the RTS.
7  *
8  * ---------------------------------------------------------------------------*/
9
10 extern void *stgMallocBytes(int n, char *msg);
11 extern void *stgMallocWords(int n, char *msg);
12 extern void *stgReallocBytes(void *p, int n, char *msg);
13 extern void *stgReallocWords(void *p, int n, char *msg);
14 extern void *stgCallocBytes(int n, int m, char *msg);
15 extern void stgFree(void* p);
16
17 extern void barf(char *s, ...) __attribute__((__noreturn__)) ;
18 extern void belch(char *s, ...);
19 extern void prog_belch(char *s, ...);
20
21 extern void _stgAssert (char *filename, unsigned int linenum);
22
23 extern void heapOverflow(void);
24
25 extern void setNonBlockingFd(int fd);
26 extern void resetNonBlockingFd(int fd);
27
28 extern nat stg_strlen(char *str);
29
30 /*Defined in Main.c, but made visible here*/
31 extern void stg_exit(I_ n) __attribute__((noreturn));
32
33 char *time_str(void);
34 char *ullong_format_string(ullong, char *, rtsBool);
35
36 #ifdef PAR
37 ullong   msTime(void);
38 #endif
39
40 #ifdef DEBUG
41 extern void heapCheckFail( void );
42 #endif