/* -----------------------------------------------------------------------------
- * $Id: MBlock.c,v 1.13 1999/12/15 09:43:24 simonmar Exp $
+ * $Id: MBlock.c,v 1.18 2000/09/06 11:12:07 rrt Exp $
*
* (c) The GHC Team 1998-1999
*
#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
/* NetBSD i386 shared libs are at 0x40000000
*/
#define ASK_FOR_MEM_AT 0x50000000
+#elif openbsd_TARGET_OS
+#define ASK_FOR_MEM_AT 0x50000000
#elif linux_TARGET_OS
/* Any ideas?
*/
#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 *
if ( (base_non_committed == 0) ||
(next_request + size > base_non_committed + SIZE_RESERVED_POOL) ) {
+#ifdef ENABLE_WIN32_DLL_SUPPORT
+ if (base_non_committed)
+ barf("Windows programs can only use 128Mb of heap; sorry!");
+#endif
base_non_committed = VirtualAlloc ( NULL
, SIZE_RESERVED_POOL
, MEM_RESERVE