By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,244 Members | 1,772 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,244 IT Pros & Developers. It's quick & easy.

What is memory pool

P: n/a
hi
could any one explain with example the following in a better way to
understand
1. what is stack in memory, how the programs are stored in stack , what
is the use of stack
2. What is heap in memory, how the programs are stored in heap , what
is the use of heap
3. what is pool memory otherwise memory pool, what is the use of memory
pool
4. what is difference between stack and heap
5. what is the difference b/w pool and stack
6. what is the difference b/w pool and heap


thanks in advance

Nov 14 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a

"bull" <ra**************************@ericsson.com> wrote in message
news:d2**********@newstree.wise.edt.ericsson.se...
hi
could any one explain with example the following in a better way to
understand
1. what is stack in memory, how the programs are stored in stack , what is
the use of stack
2. What is heap in memory, how the programs are stored in heap , what is
the use of heap
3. what is pool memory otherwise memory pool, what is the use of memory
pool
4. what is difference between stack and heap
5. what is the difference b/w pool and stack
6. what is the difference b/w pool and heap


thanks in advance


These concepts are all irrelevant as far as c programming is concerned.
Allan
Nov 14 '05 #2

P: n/a
bull wrote:

could any one explain with example the following in a better way
to understand
1. what is stack in memory, how the programs are stored in stack ,
what is the use of stack
2. What is heap in memory, how the programs are stored in heap ,
what is the use of heap
3. what is pool memory otherwise memory pool, what is the use of
memory pool
4. what is difference between stack and heap
5. what is the difference b/w pool and stack
6. what is the difference b/w pool and heap


None of those things necessarily exist in C. We have automatic
memory, which is allocated on function entry and deallocated on
function exit, and static memory, which is allocated until program
completion. A subset of static memory is controlled memory,
assigned by malloc, realloc, and calloc, and released by free.
Where and how these things are supplied has nothing to do with a C
program.

Some systems use a stack for automatic memory, but this is not the
only possible method.

--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson

Nov 14 '05 #3

P: n/a
bull wrote:
hi
could any one explain with example the following in a better way to
understand These are general programming questions and best discussed in
news:comp.programming. Followups set.
1. what is stack in memory, how the programs are stored in stack , what
is the use of stack Stack memory is memory that is treated like a stack of dishes:
first in, first out (FIFO).

I don't know of any programs that are stored in stack memory, but
that doesn't mean there aren't any.

Many programs use stack memory for temporary variables and also to
store return addresses. The stack data structure is convenient here
because the temporary variables can be "popped" off, restoring the
memory area to where it was before the temporary variables were
created. Search the web for "data structure stack" for more
information (or read a good text book on data structures).

2. What is heap in memory, how the programs are stored in heap , what
is the use of heap Generally speaking, a heap of memory is an area of memory that the
program uses for run-time allocation of data.

Programs can be stored in the heap, but I don't know of any
languages that store functions in a heap. Although one could
consider the memory that the operating system uses as a heap
and a program is loaded into this heap and executed. To
store a program in the heap, just move the executable code
into the heap.

3. what is pool memory otherwise memory pool, what is the use of memory
pool A memory pool is a vague concept. Sometimes it is a synonym
for a heap. Other times it is memory shared by more than
one task. Another definition is an area reserved by the
program for allocation; versus a heap used by the language
or operating system.

4. what is difference between stack and heap
5. what is the difference b/w pool and stack
6. what is the difference b/w pool and heap


thanks in advance

--
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
http://www.sgi.com/tech/stl -- Standard Template Library
Nov 14 '05 #4

P: n/a
I covered heap and pool-managed memory in my article on Memory Management:

http://www.ibm.com/developerworks/li...rary/l-memory/

Jon
----
Learn to program using Linux assembly language
http://www.cafeshops.com/bartlettpublish.8640017
Nov 14 '05 #5

P: n/a
CBFalconer <cb********@yahoo.com> writes:
[...]
None of those things necessarily exist in C. We have automatic
memory, which is allocated on function entry and deallocated on
function exit, and static memory, which is allocated until program
completion. A subset of static memory is controlled memory,
assigned by malloc, realloc, and calloc, and released by free.
Where and how these things are supplied has nothing to do with a C
program.


A terminology quibble: I don't think the term "static" applies to
malloc()-allocated memory.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 14 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.