Re: About stack size
From: Niklas Borson (niklasb_at_microsoft.com)
Date: 10 Sep 2004 01:54:13 -0700
Alwyn <firstname.lastname@example.org> wrote in message news:<email@example.com>...
> In article <DN50d.firstname.lastname@example.org>, Sam
> Sungshik Kong <email@example.com> 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:
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.)