07-08-07 06:21 PM
"Nehil" <nehilparashar@gmail.com> wrote in message
news:1183894832.890803.254790@r34g2000hsd.googlegroups.com...
>I would like to know which is dynamic in nature.
> if i refer the C memory model (Richard Steven), it is shown that both
> stack and heap grow towards each other.
> Now, can one go into other's area and hence effecting the size of
> other memory area.
>
> Does any limit exist upto which a stack or a heap can grow. and if it
> is there then who decides the limit?
Stack and heap are in some sense related concepts, except for the required
order of release. It is not uncommon with certain development tools to have
functions that will claim space on the stack and return a pointer (similar
to malloc). However, such claimed areas have to be released from the bottom
up (they can't be preserved when a function returns).
In a modern operating system (on modern hardware), the limit is typically a
feature of the operating system on the platform. 4GB is typical. It
doesn't normally make sense to have this limit configurable -- with modern
hardware (pages, page faults, and all that) the system can normally move
stuff around as the program's memory needs grow until the limit is reached.
--
David T. Ashley (dta@e3ft.com)
http://www.e3ft.com (Consulting Home Page)
http://www.dtashley.com (Personal Home Page)
http://gpl.e3ft.com (GPL Publications and Projects)
[ Post a follow-up to this message ]
|