/* -----------------------------------------------------------------------------
- * $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
*
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
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...