Mail Archives: djgpp/1999/08/01/07:30:09
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
- Raw text -