[project @ 2001-12-10 01:27:59 by sebc]
[ghc-hetmet.git] / ghc / rts / MBlock.h
1 /* -----------------------------------------------------------------------------
2  * $Id: MBlock.h,v 1.11 2001/12/10 01:28:00 sebc Exp $
3  *
4  * (c) The GHC Team, 1998-1999
5  *
6  * MegaBlock Allocator interface.
7  *
8  * ---------------------------------------------------------------------------*/
9
10 extern lnat mblocks_allocated;
11
12 #ifdef ENABLE_WIN32_DLL_SUPPORT
13 extern int is_heap_alloced(const void* p);
14 #endif
15
16 extern void * getMBlock(void);
17 extern void * getMBlocks(nat n);
18
19 #if freebsd2_TARGET_OS || freebsd_TARGET_OS
20 /* Executable is loaded from      0x0
21  * Shared libraries are loaded at 0x2000000
22  * Stack is at the top of the address space.  The kernel probably owns
23  * 0x8000000 onwards, so we'll pick 0x5000000.
24  */
25 #define HEAP_BASE 0x50000000
26
27 #elif netbsd_TARGET_OS
28 /* NetBSD i386 shared libs are at 0x40000000
29  */
30 #define HEAP_BASE 0x50000000
31 #elif openbsd_TARGET_OS
32 #define HEAP_BASE 0x50000000
33 #elif linux_TARGET_OS
34 /* Any ideas?
35  */
36 #define HEAP_BASE 0x50000000
37
38 #elif solaris2_TARGET_OS
39 /* guess */
40 #define HEAP_BASE 0x50000000
41
42 #elif osf3_TARGET_OS
43 /* ToDo: Perhaps by adjusting this value we can make linking without
44  * -static work (i.e., not generate a core-dumping executable)? */
45 #if SIZEOF_VOID_P == 8
46 #define HEAP_BASE 0x180000000L
47 #else
48 #error I have no idea where to begin the heap on a non-64-bit osf3 machine.
49 #endif
50
51 #elif hpux_TARGET_OS
52 /* guess */
53 #define HEAP_BASE 0x50000000
54
55 #elif darwin_TARGET_OS
56 /* guess */
57 #define HEAP_BASE 0x50000000
58
59 #elif defined(mingw32_TARGET_OS) || defined(cygwin32_TARGET_OS)
60 /* doesn't matter, we use a reserve/commit algorithm */
61
62 #else
63 #error Dont know where to get memory from on this architecture
64 /* ToDo: memory locations on other architectures */
65 #endif