<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Winter&#039;s Fall &#187; heap</title>
	<atom:link href="http://wintersfall.westernesse.net/tag/heap/feed/" rel="self" type="application/rss+xml" />
	<link>http://wintersfall.westernesse.net</link>
	<description>Geekery. Imitating. Life.</description>
	<lastBuildDate>Sun, 11 Apr 2010 21:45:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>on multiple runtimes</title>
		<link>http://wintersfall.westernesse.net/2008/12/14/on-multiple-runtimes/</link>
		<comments>http://wintersfall.westernesse.net/2008/12/14/on-multiple-runtimes/#comments</comments>
		<pubDate>Mon, 15 Dec 2008 05:41:14 +0000</pubDate>
		<dc:creator>tallganglyguy</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[heap]]></category>
		<category><![CDATA[msvc]]></category>
		<category><![CDATA[runtime]]></category>

		<guid isPermaLink="false">http://wintersfall.westernesse.net/?p=137</guid>
		<description><![CDATA[When a DLL links against a different runtime library than your executable things are bound to go awry. We recently ran into the fun behaviour of having multiple heaps in a program. Somehow a project got built using one C &#8230; <a href="http://wintersfall.westernesse.net/2008/12/14/on-multiple-runtimes/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>When a DLL links against a different runtime library than your executable things are bound to go awry.</p>
<p><span id="more-137"></span>We recently ran into the fun behaviour of having multiple heaps in a program. Somehow a project got built using one C run-time for the executable, and a DLL dependency got built using a different C run-time. Since, this change was not known to me, I didn&#8217;t flag it as a possible cause of the problem to the developer. Even the developer didn&#8217;t remember changing the runtime libraries.</p>
<p>The fun started as this. The DLL contained the definition of a couple of classes. Let&#8217;s call them CDataStream and CDataObject. CDataStream has a function called getNextObject() with the return type CDataObject*. The fun starts when the object is created on the heap created by the DLL&#8217;s run-time, and then you attempt to delete the object in the executable. Since the executable is using a different heap it obviously can&#8217;t delete the object returned by getNextObject(). This zapped about 8 hours of time from the developer before he finally realized what was going on.</p>
<p>No bonus points are awarded to those who point out that these sorts of problems are sovled by COM. Since this is legacy code that has been in place for several years, a rewrite can&#8217;t be justified.</p>
]]></content:encoded>
			<wfw:commentRss>http://wintersfall.westernesse.net/2008/12/14/on-multiple-runtimes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

