Re: About stack size
From: Thomas Matthews (Thomas_MatthewsSpitsOnSpamBots_at_sbcglobal.net)
Date: 09/09/04
- Next message: Alwyn: "Re: About stack size"
- Previous message: Alwyn: "Re: Problems reversing strings"
- In reply to: Sam Sungshik Kong: "About stack size"
- Next in thread: Sam Sungshik Kong: "Re: About stack size"
- Reply: Sam Sungshik Kong: "Re: About stack size"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 09 Sep 2004 19:47:01 GMT
Sam Sungshik Kong wrote:
> Hello, group!
>
> I wonder how the stack size is set (or determined by compilers) and if it
> can be resized during run-time.
There is no requirement that programs have stacks. The use of
stacks is compiler dependent.
If a compiler uses a stack, the stack size depends on the memory
of the platform. Some compilers allow one to set the stack
size as a parameter to the compiler.
> I heard that it's dynamic.
> What does it mean?
Funny, that's my question too.
This could mean that a stack can grow or shrink during
runtime as opposed to an array.
> Dynamic during compile-time or run-time?
Your program doesn't have a stack during compile time.
If a compiler uses a stack during the translation of
a program, that would be during compile-time and probably
not adjustable by the user.
Stacks, by their design, are dynamic during runtime.
Many stacks have a maximum size that they can grow
to.
> The stack area can't be divided, right?
What do you mean by divided? Please give example.
> Is it always before the start point of heap?
No. The stack is wherever the compiler implementor
decided to put it.
Is the use of a stack important to you?
Is the location of the stack or heap important to
you?
In most programs, there is no concern over a stack
or a heap; especially where they are located.
--
Thomas Matthews
C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.comeaucomputing.com/learn/faq/
Other sites:
http://www.josuttis.com -- C++ STL Library book
- Next message: Alwyn: "Re: About stack size"
- Previous message: Alwyn: "Re: Problems reversing strings"
- In reply to: Sam Sungshik Kong: "About stack size"
- Next in thread: Sam Sungshik Kong: "Re: About stack size"
- Reply: Sam Sungshik Kong: "Re: About stack size"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|