From: Martin Stromberg Message-Id: <200005111438.QAA05671@lws256.lu.erisoft.se> Subject: Re: Perfomance of gc-simple To: djgpp-workers AT delorie DOT com Date: Thu, 11 May 2000 16:38:51 +0200 (MET DST) In-Reply-To: <200005111326.JAA13160@indy.delorie.com> from "Eli Zaretskii" at May 11, 2000 09:26:59 AM X-Mailer: ELM [version 2.5 PL3] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > Btw, how is this implemented on Unix/Linux? Here's the relevant > fragment from the test program run by Grep's configure script: > > fd = open("conftestmmap", O_RDWR); > if (fd < 0) > exit(1); > data2 = malloc(2 * pagesize); > if (!data2) > exit(1); > data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1); > if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE, > MAP_PRIVATE | MAP_FIXED, fd, 0L)) > exit(1); > > This expects mmap to return the same address as malloc did (modulo the > alignment). Since, as DJ explained, mmap uses specially-mapped memory > that can be grown at will without relocating, does this mean that mmap > has to fiddle with the page tables to move the buffer to another > physical address while keeping its logical address unchanged? But Solaris' man page says: "The use of MAP_FIXED is discouraged, as it may prevent an implementation from making the most effective use of system resources." I also saw a similar statement on Linux. So it's strange that a test for mmap() uses a feature that is discouraged! Right, MartinS