New implementation of BLACKHOLEs
[ghc-hetmet.git] / rts / posix / OSMem.c
index 5d46e68..608345b 100644 (file)
@@ -131,8 +131,9 @@ my_mmap (void *addr, lnat size)
            (errno == EINVAL && sizeof(void*)==4 && size >= 0xc0000000)) {
            // If we request more than 3Gig, then we get EINVAL
            // instead of ENOMEM (at least on Linux).
-           errorBelch("out of memory (requested %lu bytes)", size);
-           stg_exit(EXIT_FAILURE);
+           barf("out of memory (requested %lu bytes)", size);
+//            abort();
+//         stg_exit(EXIT_FAILURE);
        } else {
            barf("getMBlock: mmap: %s", strerror(errno));
        }
@@ -158,10 +159,10 @@ gen_map_mblocks (lnat size)
     // unmap the slop bits around the chunk we allocated
     slop = (W_)ret & MBLOCK_MASK;
     
-    if (munmap(ret, MBLOCK_SIZE - slop) == -1) {
+    if (munmap((void*)ret, MBLOCK_SIZE - slop) == -1) {
       barf("gen_map_mblocks: munmap failed");
     }
-    if (slop > 0 && munmap(ret+size-slop, slop) == -1) {
+    if (slop > 0 && munmap((void*)(ret+size-slop), slop) == -1) {
       barf("gen_map_mblocks: munmap failed");
     }