<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Free store is not free lunch</title>
	<atom:link href="http://embeddedgurus.com/state-space/2010/01/free-store-is-not-free-lunch/feed/" rel="self" type="application/rss+xml" />
	<link>http://embeddedgurus.com/state-space/2010/01/free-store-is-not-free-lunch/</link>
	<description>A Blog by Miro Samek</description>
	<lastBuildDate>Tue, 08 May 2012 09:20:07 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Peter Bushell</title>
		<link>http://embeddedgurus.com/state-space/2010/01/free-store-is-not-free-lunch/comment-page-1/#comment-9378</link>
		<dc:creator>Peter Bushell</dc:creator>
		<pubDate>Tue, 19 Jul 2011 08:26:57 +0000</pubDate>
		<guid isPermaLink="false">http://embeddedgurus.com/state-space/2010/01/29/free-store-is-not-free-lunch/#comment-9378</guid>
		<description>Actually, fragmentation was acknowledged as a problem in Miro&#039;s previous post: &quot;A Heap of Problems&quot;, so my assertion that it had been ignored applies only to this article, which is a bit parochial of me. Sorry about that!</description>
		<content:encoded><![CDATA[<p>Actually, fragmentation was acknowledged as a problem in Miro&#8217;s previous post: &#8220;A Heap of Problems&#8221;, so my assertion that it had been ignored applies only to this article, which is a bit parochial of me. Sorry about that!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Bushell</title>
		<link>http://embeddedgurus.com/state-space/2010/01/free-store-is-not-free-lunch/comment-page-1/#comment-9376</link>
		<dc:creator>Peter Bushell</dc:creator>
		<pubDate>Tue, 19 Jul 2011 08:21:20 +0000</pubDate>
		<guid isPermaLink="false">http://embeddedgurus.com/state-space/2010/01/29/free-store-is-not-free-lunch/#comment-9376</guid>
		<description>Apart from the timing uncertainty inherent in using a heap, there is the issue of fragmentation, leading, effectively, to a progressive reduction in the total memory available for allocation. This is a *very important consideration* in most embedded systems and, as usual, it has been ignored.

As John has hinted, it is possible to provide alternative allocation strategies in C++, but this is not just about STL (which I hate, anyway). It is possible to eliminate the heap entirely and to provide per-class pools for those ob jects which are to be allocated dynamically. These, having fixed-size blocks, are immune to fragmentation. Furthermore, fixing the pool sizes at design time and attaching each pool to a specific class limits the scope of memory starvation problems and allows them to be found and fixed more easily. The space overhead for each pool is very low and timings are fast and determinate.

Maybe it sounds hard to do all this. Well, designing the necessary templates, etc., took me some time, but they are very easy to use (by simple inheritance) and completely transparent in operation (just use &quot;new&quot; and &quot;delete&quot;, as before).

I&#039;ve been quite evangelical about this subject on my blog (link available on the home page of this blog), and my code is available there for download via the &quot;subscribers&quot; page. There&#039;s a new, better documented version on its way quite soon. Any comments on my viewpoint - either here or there - greatly appreciated.</description>
		<content:encoded><![CDATA[<p>Apart from the timing uncertainty inherent in using a heap, there is the issue of fragmentation, leading, effectively, to a progressive reduction in the total memory available for allocation. This is a *very important consideration* in most embedded systems and, as usual, it has been ignored.</p>
<p>As John has hinted, it is possible to provide alternative allocation strategies in C++, but this is not just about STL (which I hate, anyway). It is possible to eliminate the heap entirely and to provide per-class pools for those ob jects which are to be allocated dynamically. These, having fixed-size blocks, are immune to fragmentation. Furthermore, fixing the pool sizes at design time and attaching each pool to a specific class limits the scope of memory starvation problems and allows them to be found and fixed more easily. The space overhead for each pool is very low and timings are fast and determinate.</p>
<p>Maybe it sounds hard to do all this. Well, designing the necessary templates, etc., took me some time, but they are very easy to use (by simple inheritance) and completely transparent in operation (just use &#8220;new&#8221; and &#8220;delete&#8221;, as before).</p>
<p>I&#8217;ve been quite evangelical about this subject on my blog (link available on the home page of this blog), and my code is available there for download via the &#8220;subscribers&#8221; page. There&#8217;s a new, better documented version on its way quite soon. Any comments on my viewpoint &#8211; either here or there &#8211; greatly appreciated.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Wellbelove</title>
		<link>http://embeddedgurus.com/state-space/2010/01/free-store-is-not-free-lunch/comment-page-1/#comment-8107</link>
		<dc:creator>John Wellbelove</dc:creator>
		<pubDate>Mon, 20 Jun 2011 19:59:26 +0000</pubDate>
		<guid isPermaLink="false">http://embeddedgurus.com/state-space/2010/01/29/free-store-is-not-free-lunch/#comment-8107</guid>
		<description>&quot;For example, most standard C++ libraries (e.g., STL, Boost, etc.) requrie the heap. Without it, C++ simply does not feel like the same language.&quot;

It&#039;s possible to create alternate allocators for STL. I recently published an article on Codeguru decribing an allocator that takes its resources from the stack, so that STL containers can be used as local variables in functions, without touching the heap at all.</description>
		<content:encoded><![CDATA[<p>&#8220;For example, most standard C++ libraries (e.g., STL, Boost, etc.) requrie the heap. Without it, C++ simply does not feel like the same language.&#8221;</p>
<p>It&#8217;s possible to create alternate allocators for STL. I recently published an article on Codeguru decribing an allocator that takes its resources from the stack, so that STL containers can be used as local variables in functions, without touching the heap at all.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tad huskie</title>
		<link>http://embeddedgurus.com/state-space/2010/01/free-store-is-not-free-lunch/comment-page-1/#comment-54</link>
		<dc:creator>Tad huskie</dc:creator>
		<pubDate>Sat, 03 Apr 2010 13:08:04 +0000</pubDate>
		<guid isPermaLink="false">http://embeddedgurus.com/state-space/2010/01/29/free-store-is-not-free-lunch/#comment-54</guid>
		<description>Right, regarding no 4., I used to meet this issue. Once as in writing some code into a pic, I tried putting code into an interrupt service routine, the result in simulator informs that so lots of stack overflow and underflow, I hadn&#039;t figured it out until moving all code out of ISR, just using some bit as flags in that, and it did really work. So as a rule of thumb, ISR is very sensitive, as little code using the heap as possible!</description>
		<content:encoded><![CDATA[<p>Right, regarding no 4., I used to meet this issue. Once as in writing some code into a pic, I tried putting code into an interrupt service routine, the result in simulator informs that so lots of stack overflow and underflow, I hadn&#8217;t figured it out until moving all code out of ISR, just using some bit as flags in that, and it did really work. So as a rule of thumb, ISR is very sensitive, as little code using the heap as possible!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

