[project @ 2001-01-16 11:53:32 by simonmar]
[ghc-hetmet.git] / ghc / rts / MBlock.h
1 /* -----------------------------------------------------------------------------
2  * $Id: MBlock.h,v 1.8 2001/01/16 11:53:32 simonmar 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 /* guess */
44 #define HEAP_BASE 0x50000000
45
46 #elif hpux_TARGET_OS
47 /* guess */
48 #define HEAP_BASE 0x50000000
49
50 #elif macosx_TARGET_OS
51 /* guess */
52 #define HEAP_BASE 0x50000000
53
54 #elif _WIN32
55 /* doesn't matter, we use a reserve/commit algorithm */
56
57 #else
58 #error Dont know where to get memory from on this architecture
59 /* ToDo: memory locations on other architectures */
60 #endif