22 Oct 2005 11:54
Fixing "OS allocated a heap in high memory"
Donald Bruce Stewart <dons <at> cse.unsw.edu.au>
2005-10-22 09:54:02 GMT
2005-10-22 09:54:02 GMT
Hey guys, Recent changes to malloc on OpenBSD mean that nhc98 builds now die with the "OS allocated a heap in high memory" error, as malloc is putting things above the 0x80000000 line. Switching the heap allocation to use mmap with a hint to allocate somewhere lower fixes it at least on x86/openbsd. The ghc testsuite runs, for example. The mmap code is stolen from MBlock.c in ghc. Any options on this? Is it reasonable? (I'd like to use it as a custom patch in the OpenBSD port of nhc98, but want to check I'm not doing anything hideously wrong :) -- Don Here's what I'm doing: --- src/runtime/Kernel/collector.c.orig Tue Mar 8 03:53:38 2005 +++ src/runtime/Kernel/collector.c Sat Oct 22 19:05:22 2005 <at> <at> -7,6 +7,11 <at> <at> /*#include "runtime.h" -- already included in node.h */ #include "mark.h" +#include <errno.h> +#include <sys/types.h> +#include <sys/mman.h> + + /*#define HEAPSIZE 100000 -- defined in top-level Makefile at config-time */(Continue reading)
RSS Feed