1 /* -----------------------------------------------------------------------------
2 * $Id: MBlock.h,v 1.12 2002/01/21 17:18:43 sof Exp $
4 * (c) The GHC Team, 1998-1999
6 * MegaBlock Allocator interface.
8 * ---------------------------------------------------------------------------*/
11 extern lnat mblocks_allocated;
13 #ifdef ENABLE_WIN32_DLL_SUPPORT
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 #define HEAP_BASE 0x50000000
39 #elif solaris2_TARGET_OS
41 #define HEAP_BASE 0x50000000
44 /* ToDo: Perhaps by adjusting this value we can make linking without
45 * -static work (i.e., not generate a core-dumping executable)? */
46 #if SIZEOF_VOID_P == 8
47 #define HEAP_BASE 0x180000000L
49 #error I have no idea where to begin the heap on a non-64-bit osf3 machine.
54 #define HEAP_BASE 0x50000000
56 #elif darwin_TARGET_OS
58 #define HEAP_BASE 0x50000000
60 #elif defined(mingw32_TARGET_OS) || defined(cygwin32_TARGET_OS)
61 /* doesn't matter, we use a reserve/commit algorithm */
64 #error Dont know where to get memory from on this architecture
65 /* ToDo: memory locations on other architectures */