From a324b415d33bf851ba858db1295c1715fdbfc6da Mon Sep 17 00:00:00 2001 From: wolfgang Date: Tue, 5 Nov 2002 22:31:53 +0000 Subject: [PATCH] [project @ 2002-11-05 22:31:53 by wolfgang] Add the appropriate barf for memory allocation failures on Mac OS X. --- ghc/rts/MBlock.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ghc/rts/MBlock.c b/ghc/rts/MBlock.c index 6011709..96bb778 100644 --- a/ghc/rts/MBlock.c +++ b/ghc/rts/MBlock.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: MBlock.c,v 1.36 2002/11/05 09:31:37 simonmar Exp $ + * $Id: MBlock.c,v 1.37 2002/11/05 22:31:53 wolfgang 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 -- 1.7.10.4