[project @ 2000-05-19 09:49:00 by simonmar]
[ghc-hetmet.git] / ghc / rts / MBlock.c
index 2626304..c0a619f 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: MBlock.c,v 1.12 1999/09/16 08:37:08 sof Exp $
+ * $Id: MBlock.c,v 1.15 2000/04/03 15:24:21 rrt Exp $
  *
  * (c) The GHC Team 1998-1999
  *
@@ -39,7 +39,7 @@
 #include <windows.h>
 #endif
 
-#if freebsd2_TARGET_OS || freebsd3_TARGET_OS
+#if freebsd2_TARGET_OS || freebsd_TARGET_OS
 /* Executable is loaded from      0x0
  * Shared libraries are loaded at 0x2000000
  * Stack is at the top of the address space.  The kernel probably owns
  */
 #define ASK_FOR_MEM_AT 0x50000000
 
+#elif netbsd_TARGET_OS
+/* NetBSD i386 shared libs are at 0x40000000
+ */
+#define ASK_FOR_MEM_AT 0x50000000
 #elif linux_TARGET_OS
 /* Any ideas?
  */
@@ -148,11 +152,12 @@ char* base_non_committed = (char*)0;
 #define SIZE_RESERVED_POOL  ( 128 * 1024 * 1024 )
 
 /* This predicate should be inlined, really. */
+/* TODO: this only works for a single chunk */
 int
 is_heap_alloced(const void* x)
 {
   return (((char*)(x) >= base_non_committed) && 
-          ((char*)(x) <= (base_non_committed + 128 * 1024 * 1024)));
+          ((char*)(x) <= (base_non_committed + SIZE_RESERVED_POOL)));
 }
 
 void *