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