Commit 0ab0232d authored by Simon Marlow's avatar Simon Marlow
Browse files

mmap() errors on Darwin: use errorBelch/exit instead of barf()

The most likely cause is out-of-memory, not an RTS error.
parent 04c0256a
......@@ -181,10 +181,14 @@ my_mmap (void *addr, lnat size)
if(!addr || err) // try to allocate anywhere
err = vm_allocate(mach_task_self(),(vm_address_t*) &ret, size, TRUE);
if(err) // don't know what the error codes mean exactly
barf("memory allocation failed (requested %lu bytes)", size);
if(err) {
// don't know what the error codes mean exactly, assume it's
// not our problem though.
errorBelch("memory allocation failed (requested %lu bytes)", size);
} else {
ret = mmap(addr, size, PROT_READ | PROT_WRITE | PROT_EXEC,
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment