Sender: nate AT cartsys DOT com Message-ID: <37A3ADC9.F4D9D8C2@cartsys.com> Date: Sat, 31 Jul 1999 19:15:37 -0700 From: Nate Eldredge X-Mailer: Mozilla 4.08 [en] (X11; I; Linux 2.2.10 i586) MIME-Version: 1.0 To: djgpp AT delorie DOT com Subject: Re: Fixed stack size? References: <7nepgn$34o$2 AT news DOT luth DOT se> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp AT delorie DOT com Martin Str|mberg wrote: > > Eli Zaretskii (eliz AT is DOT elta DOT co DOT il) wrote: > : > : On 25 Jul 1999, Martin Str|mberg wrote: > : > : > Ah... But why isn't it placed as high as possible so it can grow down > : > (as it usually does in Un*x)? > : > : That was tried in v1.x, and the result was that -fomit-frame-pointer > : pointer was broken. The problem is that a special expand-down stack > : segment ties up the BP register, and you cannot use it as a GP register > : anymore. > > Hmm. I wonder how Linux handles this? Paging. Linux places everything in one segment which fills the address space (effectively disabling segmentation). The stack top is placed at an arbitrary address. When this space is touched, page faults allocate a piece of memory for it. An arbitrary (and changeable) limit is placed to stop infinite recursion; when the stack grows below size X, the kernel signals the process appropriately instead of giving it more memory. -- Nate Eldredge nate AT cartsys DOT com