1 /* -----------------------------------------------------------------------------
2 * $Id: MBlock.h,v 1.10 2001/07/26 03:26:28 ken Exp $
4 * (c) The GHC Team, 1998-1999
6 * MegaBlock Allocator interface.
8 * ---------------------------------------------------------------------------*/
10 extern lnat mblocks_allocated;
12 #ifdef ENABLE_WIN32_DLL_SUPPORT
13 extern int is_heap_alloced(const void* p);
16 extern void * getMBlock(void);
17 extern void * getMBlocks(nat n);
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.
25 #define HEAP_BASE 0x50000000
27 #elif netbsd_TARGET_OS
28 /* NetBSD i386 shared libs are at 0x40000000
30 #define HEAP_BASE 0x50000000
31 #elif openbsd_TARGET_OS
32 #define HEAP_BASE 0x50000000
36 #define HEAP_BASE 0x50000000
38 #elif solaris2_TARGET_OS
40 #define HEAP_BASE 0x50000000
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
48 #error I have no idea where to begin the heap on a non-64-bit osf3 machine.
53 #define HEAP_BASE 0x50000000
55 #elif macosx_TARGET_OS
57 #define HEAP_BASE 0x50000000
59 #elif defined(mingw32_TARGET_OS) || defined(cygwin32_TARGET_OS)
60 /* doesn't matter, we use a reserve/commit algorithm */
63 #error Dont know where to get memory from on this architecture
64 /* ToDo: memory locations on other architectures */