[project @ 2002-11-18 14:35:57 by simonpj]
[ghc-hetmet.git] / ghc / rts / MBlock.c
index 6011709..57d113a 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: MBlock.c,v 1.36 2002/11/05 09:31:37 simonmar Exp $
+ * $Id: MBlock.c,v 1.38 2002/11/07 14:42:25 simonmar Exp $
  *
  * (c) The GHC Team 1998-1999
  *
@@ -120,8 +120,8 @@ my_mmap (void *addr, int size)
     if(!addr || err)   // try to allocate anywhere
        err = vm_allocate(mach_task_self(),(vm_address_t*) &ret, size, TRUE);
        
-    if(err)
-       ret = (void*) -1;
+    if(err) // don't know what the error codes mean exactly
+       barf("memory allocation failed (requested %d bytes)", size);
     else
        vm_protect(mach_task_self(),ret,size,FALSE,VM_PROT_READ|VM_PROT_WRITE);
 #else
@@ -193,7 +193,7 @@ getMBlocks(nat n)
       if (((W_)ret & MBLOCK_MASK) != 0) {
          // misaligned block!
 #ifdef DEBUG
-         belch("getMBlock: misaligned block %p returned when allocating %d megablock(s) at %p", ret, n, next_request);
+         belch("warning: getMBlock: misaligned block %p returned when allocating %d megablock(s) at %p", ret, n, next_request);
 #endif
          
          // unmap this block...