1 /* -----------------------------------------------------------------------------
2 * $Id: MBlock.h,v 1.14 2002/05/14 08:15:49 matthewc Exp $
4 * (c) The GHC Team, 1998-1999
6 * MegaBlock Allocator interface.
8 * ---------------------------------------------------------------------------*/
11 extern lnat mblocks_allocated;
13 #if defined(mingw32_TARGET_OS)
14 extern int is_heap_alloced(const void* p);
17 extern void * getMBlock(void);
18 extern void * getMBlocks(nat n);
20 #if freebsd2_TARGET_OS || freebsd_TARGET_OS
21 /* Executable is loaded from 0x0
22 * Shared libraries are loaded at 0x2000000
23 * Stack is at the top of the address space. The kernel probably owns
24 * 0x8000000 onwards, so we'll pick 0x5000000.
26 #define HEAP_BASE 0x50000000
28 #elif netbsd_TARGET_OS
29 /* NetBSD i386 shared libs are at 0x40000000
31 #define HEAP_BASE 0x50000000
32 #elif openbsd_TARGET_OS
33 #define HEAP_BASE 0x50000000
37 /* Shared libraries are in region 1, text in region 2, data in region 3.
38 * Stack is at the top of region 4. We use the bottom.
40 #define HEAP_BASE (4L<<61)
44 #define HEAP_BASE 0x50000000
47 #elif solaris2_TARGET_OS
49 #define HEAP_BASE 0x50000000
52 /* ToDo: Perhaps by adjusting this value we can make linking without
53 * -static work (i.e., not generate a core-dumping executable)? */
54 #if SIZEOF_VOID_P == 8
55 #define HEAP_BASE 0x180000000L
57 #error I have no idea where to begin the heap on a non-64-bit osf3 machine.
62 #define HEAP_BASE 0x50000000
64 #elif darwin_TARGET_OS
66 #define HEAP_BASE 0x50000000
68 #elif defined(mingw32_TARGET_OS) || defined(cygwin32_TARGET_OS)
69 /* doesn't matter, we use a reserve/commit algorithm */
72 #error Dont know where to get memory from on this architecture
73 /* ToDo: memory locations on other architectures */