<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: 7.9 &#8212; The stack and the heap</title>
	<atom:link href="http://www.learncpp.com/cpp-tutorial/79-the-stack-and-the-heap/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.learncpp.com/cpp-tutorial/79-the-stack-and-the-heap/</link>
	<description></description>
	<pubDate>Wed, 19 Nov 2008 17:15:45 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Alex</title>
		<link>http://www.learncpp.com/cpp-tutorial/79-the-stack-and-the-heap/#comment-31816</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Sat, 08 Nov 2008 19:25:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/79-the-stack-and-the-heap/#comment-31816</guid>
		<description>It appears that way.  I've never used alloca.  It's not part of standard C either, so I would avoid it's use.</description>
		<content:encoded><![CDATA[<p>It appears that way.  I&#8217;ve never used alloca.  It&#8217;s not part of standard C either, so I would avoid it&#8217;s use.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: som shekhar</title>
		<link>http://www.learncpp.com/cpp-tutorial/79-the-stack-and-the-heap/#comment-31653</link>
		<dc:creator>som shekhar</dc:creator>
		<pubDate>Wed, 05 Nov 2008 11:18:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/79-the-stack-and-the-heap/#comment-31653</guid>
		<description>Sorry its not malloc ..its alloca..
i guess alloca dynamically creates memory on stack?</description>
		<content:encoded><![CDATA[<p>Sorry its not malloc ..its alloca..<br />
i guess alloca dynamically creates memory on stack?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.learncpp.com/cpp-tutorial/79-the-stack-and-the-heap/#comment-31636</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Wed, 05 Nov 2008 06:38:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/79-the-stack-and-the-heap/#comment-31636</guid>
		<description>I don't understand the question.  Malloc allocates memory on the heap.  For those of you who don't know what malloc is, it's the old C-style way of dynamically allocating memory.  In C++, it is essentially deprecated in favor of the new operator.</description>
		<content:encoded><![CDATA[<p>I don&#8217;t understand the question.  Malloc allocates memory on the heap.  For those of you who don&#8217;t know what malloc is, it&#8217;s the old C-style way of dynamically allocating memory.  In C++, it is essentially deprecated in favor of the new operator.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: som shekhar</title>
		<link>http://www.learncpp.com/cpp-tutorial/79-the-stack-and-the-heap/#comment-31579</link>
		<dc:creator>som shekhar</dc:creator>
		<pubDate>Tue, 04 Nov 2008 08:08:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/79-the-stack-and-the-heap/#comment-31579</guid>
		<description>Since malloc also allocates the size dynamically but it does on stack??? why?</description>
		<content:encoded><![CDATA[<p>Since malloc also allocates the size dynamically but it does on stack??? why?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Learn C++ - &#187; 15.3 &#8212; Exceptions, functions, and stack unwinding</title>
		<link>http://www.learncpp.com/cpp-tutorial/79-the-stack-and-the-heap/#comment-30972</link>
		<dc:creator>Learn C++ - &#187; 15.3 &#8212; Exceptions, functions, and stack unwinding</dc:creator>
		<pubDate>Sat, 25 Oct 2008 18:42:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/79-the-stack-and-the-heap/#comment-30972</guid>
		<description>[...] is found, or until main() terminates. This process is called unwinding the stack (see the lesson on the stack and the heap if you need a refresher on what the call stack [...]</description>
		<content:encoded><![CDATA[<p>[...] is found, or until main() terminates. This process is called unwinding the stack (see the lesson on the stack and the heap if you need a refresher on what the call stack [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Learn C++ - &#187; 7.8 &#8212; Function Pointers</title>
		<link>http://www.learncpp.com/cpp-tutorial/79-the-stack-and-the-heap/#comment-13494</link>
		<dc:creator>Learn C++ - &#187; 7.8 &#8212; Function Pointers</dc:creator>
		<pubDate>Tue, 29 Apr 2008 05:05:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/79-the-stack-and-the-heap/#comment-13494</guid>
		<description>[...] 2007      Prev/Next Posts   &#171; 7.7 &#8212; Default parameters &#124; Home &#124; 7.9 &#8212; The stack and the heap &#187;     Wednesday, August 8th, 2007 at 4:52 [...]</description>
		<content:encoded><![CDATA[<p>[...] 2007      Prev/Next Posts   &laquo; 7.7 &#8212; Default parameters | Home | 7.9 &#8212; The stack and the heap &raquo;     Wednesday, August 8th, 2007 at 4:52 [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.learncpp.com/cpp-tutorial/79-the-stack-and-the-heap/#comment-13002</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Fri, 25 Apr 2008 02:24:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/79-the-stack-and-the-heap/#comment-13002</guid>
		<description>I won't say there isn't a way to determine the stack size, but I'm not aware of how to do it.

In reality, the stack is large enough that it's generally not an issue as long as you're aware that you should use dynamic allocation for anything that requires a large amount of memory.</description>
		<content:encoded><![CDATA[<p>I won&#8217;t say there isn&#8217;t a way to determine the stack size, but I&#8217;m not aware of how to do it.</p>
<p>In reality, the stack is large enough that it&#8217;s generally not an issue as long as you&#8217;re aware that you should use dynamic allocation for anything that requires a large amount of memory.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff</title>
		<link>http://www.learncpp.com/cpp-tutorial/79-the-stack-and-the-heap/#comment-12951</link>
		<dc:creator>Jeff</dc:creator>
		<pubDate>Thu, 24 Apr 2008 22:05:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/79-the-stack-and-the-heap/#comment-12951</guid>
		<description>Alex,

This is a really good section, very helpful for me!  Quick question:

Other than writing a function or program to test limits until it crashes, is there an easier to way to determine the size, or amount of memory, allocated to the call stack for a particular program?  Wouldn't knowing this in advance help to avoid stack overflow in more complex programs?

Thanks,
Jeff</description>
		<content:encoded><![CDATA[<p>Alex,</p>
<p>This is a really good section, very helpful for me!  Quick question:</p>
<p>Other than writing a function or program to test limits until it crashes, is there an easier to way to determine the size, or amount of memory, allocated to the call stack for a particular program?  Wouldn&#8217;t knowing this in advance help to avoid stack overflow in more complex programs?</p>
<p>Thanks,<br />
Jeff</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom</title>
		<link>http://www.learncpp.com/cpp-tutorial/79-the-stack-and-the-heap/#comment-10265</link>
		<dc:creator>Tom</dc:creator>
		<pubDate>Mon, 24 Mar 2008 15:52:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/79-the-stack-and-the-heap/#comment-10265</guid>
		<description>Hi Alex -

Good description of the stack. A few minor corrections:

"The plate analogy is &lt;b&gt;a&lt;/b&gt; pretty good analogy"

Under "The stack in action", items 5 &#38; 6 need periods at the end of the sentences.

Under "When the function terminates...":

"The &lt;b&gt;address of the&lt;/b&gt; next instruction to execute is popped off the stack, and the CPU resumes execution at that instruction."

Keep up the good work!

[ Thanks! -Alex ]</description>
		<content:encoded><![CDATA[<p>Hi Alex -</p>
<p>Good description of the stack. A few minor corrections:</p>
<p>&#8220;The plate analogy is <b>a</b> pretty good analogy&#8221;</p>
<p>Under &#8220;The stack in action&#8221;, items 5 &amp; 6 need periods at the end of the sentences.</p>
<p>Under &#8220;When the function terminates&#8230;&#8221;:</p>
<p>&#8220;The <b>address of the</b> next instruction to execute is popped off the stack, and the CPU resumes execution at that instruction.&#8221;</p>
<p>Keep up the good work!</p>
<p>[ Thanks! -Alex ]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.learncpp.com/cpp-tutorial/79-the-stack-and-the-heap/#comment-5864</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Fri, 11 Jan 2008 16:10:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/79-the-stack-and-the-heap/#comment-5864</guid>
		<description>According to &lt;a href="http://en.wikipedia.org/wiki/Stack-based_memory_allocation" rel="nofollow"&gt;Wikipedia&lt;/a&gt;, "In most modern computer systems, each thread has a reserved region of memory referred to as its stack".  So it's just RAM memory being used in a stack-like manner.  As soon as the thread/program is killed, that memory can be reused for other stuff.</description>
		<content:encoded><![CDATA[<p>According to <a href="http://en.wikipedia.org/wiki/Stack-based_memory_allocation" rel="nofollow">Wikipedia</a>, &#8220;In most modern computer systems, each thread has a reserved region of memory referred to as its stack&#8221;.  So it&#8217;s just RAM memory being used in a stack-like manner.  As soon as the thread/program is killed, that memory can be reused for other stuff.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
