(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);
+ errorBelch("out of memory (requested %lu bytes)", size);
+ stg_exit(EXIT_FAILURE);
} else {
barf("getMBlock: mmap: %s", strerror(errno));
}
// 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");
}