This is the mail archive of the
cygwin-patches@cygwin.com
mailing list for the Cygwin project.
Re: [PATCH] Large processes shared.cc fix
- From: Christopher Faylor <cgf-no-personal-reply-please at cygwin dot com>
- To: cygwin-patches at cygwin dot com
- Date: Fri, 31 Dec 2004 13:41:21 -0500
- Subject: Re: [PATCH] Large processes shared.cc fix
- References: <Pine.LNX.4.56.0412311549120.20233@inferno-01.cs.huji.ac.il>
- Reply-to: cygwin-patches at cygwin dot com
On Fri, Dec 31, 2004 at 03:58:20PM +0200, Eizenberg Ariel wrote:
>Hi,
>
>This patch fixes a problem I have with running large fortran programs
>(actually most programs with a very large image size in memory). The
>problem occurs on Windows 2000, XP and 2003.
>
>The problem occurs when a process is large enough so when open_shared()
>tries to map the shared memory section to 0x0A000000, it fails, since
>0x0A000000 is occupied by the program. Since the
>MapViewOfFileEx(h,...,NULL) is preformed on a region smaller than the full
>region required for offsets[SH_TOTAL_SIZE], MapViewOfFileEx might allocate
>a region at a location which does not have enough free space after it,
>so the VirtualAlloc's at the end of open_shared() silently fail
>(in my case MapViewOfFileEx() returns 0x3d0000).
So, why is this a problem? Why doesn't the "if (!shared)" immediately after
the first MapViewOfFileEx just avoid allocating the other non SH_CYGWIN_SHARED
shared memory regions at a fixed location? That is what that code is there
to handle.
cgf