From 24889e6abe3ef8a84809fc55ad494933df767d3d Mon Sep 17 00:00:00 2001 From: simonmar Date: Fri, 25 Oct 2002 12:56:34 +0000 Subject: [PATCH] [project @ 2002-10-25 12:56:34 by simonmar] We shouldn't be using MAP_FIXED on solaris (fixes last night's crash). Unfortunately on Solaris the heuristics don't work too well. Solaris seems to ignore the addr argument to mmap when MAP_FIXED is not specified, and starts handing out memory from the top of the address space. So we allocate 2M each time and munmap() ends to leave an aligned 1M chunk. This will eventually leave the address space completely full of 1M holes. I don't have a good solution to this at the moment. MERGE TO STABLE --- ghc/rts/MBlock.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ghc/rts/MBlock.c b/ghc/rts/MBlock.c index eb1c06d..7ada8e9 100644 --- a/ghc/rts/MBlock.c +++ b/ghc/rts/MBlock.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: MBlock.c,v 1.32 2002/10/23 12:26:11 mthomas Exp $ + * $Id: MBlock.c,v 1.33 2002/10/25 12:56:34 simonmar Exp $ * * (c) The GHC Team 1998-1999 * @@ -95,8 +95,7 @@ my_mmap (void *addr, int size) #ifdef solaris2_TARGET_OS { int fd = open("/dev/zero",O_RDONLY); - ret = mmap(addr, size, PROT_READ | PROT_WRITE, - MAP_FIXED | MAP_PRIVATE, fd, 0); + ret = mmap(addr, size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0); close(fd); } #elif hpux_TARGET_OS -- 1.7.10.4