Re: About stack size

From: Niklas Borson (niklasb_at_microsoft.com)
Date: 09/10/04


Date: 10 Sep 2004 01:54:13 -0700

Alwyn <dt015a1979@mac.com.invalid> wrote in message news:<100920040103254378%dt015a1979@mac.com.invalid>...
> In article <DN50d.18192$rm1.3153@newssvr29.news.prodigy.com>, Sam
> Sungshik Kong <ssk@chol.nospam.net> wrote:
> >
> > > Typically, the stack grows downwards from high memory and the heap
> > > grows upwards. You get stack overflow if the stack encroaches on the
> > > heap area.
> >
> > This is interesting.
> > I remember that I've seen an example program which shows static, stack, and
> > heap variables using there addresses.
> > IIRC, stack variables were placed on lower memory than heap.
> > But experiences are not very reliable.
>
> It depends on the platform, but most of them are like this:
> <http://lambda.uta.edu/cse5317/fall02/notes/node30.html>

I doubt "most" of them are like that any more. Consider a process
with multiple threads, all sharing the same address space. Each
thread will typically have its own stack. (Actually, under Windows
there are two stacks for each thread, IIRC, one for user mode and
one for kernel mode.)



Relevant Pages

  • Re: About stack size
    ... the stack grows downwards from high memory and the heap ... You get stack overflow if the stack encroaches on the ... >> heap area. ... > heap variables using there addresses. ...
    (alt.comp.lang.learn.c-cpp)
  • Re: About stack size
    ... You get stack overflow if the stack encroaches on the ... > heap area. ... heap variables using there addresses. ...
    (alt.comp.lang.learn.c-cpp)
  • Re: x86 exception handling and stack demand
    ... All of the state there is maintained in kernel-mode-only store locations and is not stored on the user mode stack. ... This varies based on all installed SEH frames, and that can vary based on OS version, third party programs installed, CRT version, and many other things. ... However, consider that in the case of a STATUS_STACK_OVERFLOW exception, the only stack available is the last committed page that was formerly marked as a guard page. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: KEYEVAL freezing header?
    ... I used this key assignment as a guide for my use. ... When I press key 84.2 while in USER mode the Header still displays the ... It just tests the stack depth and either ... "EQW" command, but I would like it to pull up a blank EQW (as it would ...
    (comp.sys.hp48)
  • Re: RFC: CONFIG_PAGE_SHIFT (aka software PAGE_SIZE)
    ... I didn't mean it was supposed to be research project in some ... given the current directions that are being pushed for mainline. ... stack anymore these days IIRC. ...
    (Linux-Kernel)