<?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: Say goodbye to memory leaks in C++ with Boost!</title>
	<atom:link href="http://wp.freya.no/c/say-goodbye-to-memory-leaks-in-c-with-boost/feed/" rel="self" type="application/rss+xml" />
	<link>http://wp.freya.no</link>
	<description>Knowledge is power</description>
	<lastBuildDate>Wed, 01 Feb 2012 17:15:04 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Fatman</title>
		<link>http://wp.freya.no/c/say-goodbye-to-memory-leaks-in-c-with-boost/comment-page-1/#comment-60</link>
		<dc:creator>Fatman</dc:creator>
		<pubDate>Mon, 08 Jun 2009 08:14:43 +0000</pubDate>
		<guid isPermaLink="false">http://wp.freya.no/?p=198#comment-60</guid>
		<description>I love Boost too, but in my testing I have found some of the more complicated modules (thread and regex) to be intermittently leaky. At least I&#039;m pretty sure they&#039;re not my leaks. Valgrind indicates they&#039;re not.

I&#039;m using 1.37 (Ubuntu hasn&#039;t caught up to 1.39 yet) so maybe these leaks have been fixed already. :)

Some examples of how easy thread and regex are:

&lt;code&gt;
namespace b = boost;
...
MyObj obj;
b::thread t = b::thread(b::bind(&amp;MyObj::thread, &amp;obj)); // spawn new thread
b::thread t2 = b::thread(b::bind(&amp;MyObj::thread, &amp;obj)); // another, why not?
...
t.join(); // wait for thread to finish
t2.join(); // wait for second thread to finish
&lt;/code&gt;

&lt;code&gt;
namespace b = boost;
...
std::string buffer = &quot;testingtestingZZ11 1ZZtestingtesting&quot;;
const b::regex fmt(&quot;[A-Z]{1,2}[0-9][0-9A-Z]? [0-9][ABDEFGHJLNPQRSTUWXYZ]{2}&quot;&quot;);
b::smatch what;
if (b::regex_search(buffer, what, fmt) {
   std::cout &lt;&lt; &quot;Found UK postcode: &quot; &lt;&lt; what[0] &lt;&lt; std::endl;
}
...
&lt;/code&gt;

Amazing!</description>
		<content:encoded><![CDATA[<p>I love Boost too, but in my testing I have found some of the more complicated modules (thread and regex) to be intermittently leaky. At least I&#8217;m pretty sure they&#8217;re not my leaks. Valgrind indicates they&#8217;re not.</p>
<p>I&#8217;m using 1.37 (Ubuntu hasn&#8217;t caught up to 1.39 yet) so maybe these leaks have been fixed already. <img src='http://wp.freya.no/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Some examples of how easy thread and regex are:</p>
<p><code><br />
namespace b = boost;<br />
...<br />
MyObj obj;<br />
b::thread t = b::thread(b::bind(&amp;MyObj::thread, &amp;obj)); // spawn new thread<br />
b::thread t2 = b::thread(b::bind(&amp;MyObj::thread, &amp;obj)); // another, why not?<br />
...<br />
t.join(); // wait for thread to finish<br />
t2.join(); // wait for second thread to finish<br />
</code></p>
<p><code><br />
namespace b = boost;<br />
...<br />
std::string buffer = "testingtestingZZ11 1ZZtestingtesting";<br />
const b::regex fmt("[A-Z]{1,2}[0-9][0-9A-Z]? [0-9][ABDEFGHJLNPQRSTUWXYZ]{2}"");<br />
b::smatch what;<br />
if (b::regex_search(buffer, what, fmt) {<br />
   std::cout &lt;&lt; &quot;Found UK postcode: &quot; &lt;&lt; what[0] &lt;&lt; std::endl;<br />
}<br />
...<br />
</code></p>
<p>Amazing!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

