8ec49cae21049b12ca7b9ce208f4fd3b24219724
[ghc.git] / rts / linker / M32Alloc.h
1 /* -----------------------------------------------------------------------------
2 *
3 * (c) The GHC Team, 2000-2012
4 *
5 * RTS Object Linker
6 *
7 * ---------------------------------------------------------------------------*/
8
9 #ifndef RTS_LINKER_M32ALLOC
10 #define RTS_LINKER_M32ALLOC
11
12 #if RTS_LINKER_USE_MMAP
13 #include <fcntl.h>
14 #include <sys/mman.h>
15
16 #ifdef HAVE_UNISTD_H
17 #include <unistd.h>
18 #endif
19
20 #endif
21
22 #include "BeginPrivate.h"
23
24 #if RTS_LINKER_USE_MMAP
25 #define M32_NO_RETURN /* Nothing */
26 #else
27 #define M32_NO_RETURN GNUC3_ATTRIBUTE(__noreturn__)
28 #endif
29
30 void m32_allocator_init(void) M32_NO_RETURN;
31
32 void m32_allocator_flush(void) M32_NO_RETURN;
33
34 void m32_free(void *addr, size_t size) M32_NO_RETURN;
35
36 void * m32_alloc(size_t size, size_t alignment) M32_NO_RETURN;
37
38 #include "EndPrivate.h"
39
40 #endif