<?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: A question of memory layout</title>
	<atom:link href="http://efesx.com/2010/01/20/a-question-of-memory-layout/feed/" rel="self" type="application/rss+xml" />
	<link>http://efesx.com/2010/01/20/a-question-of-memory-layout/</link>
	<description>Technical &#38; low level</description>
	<lastBuildDate>Mon, 30 Apr 2012 17:39:06 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: Vivek Ragunathan</title>
		<link>http://efesx.com/2010/01/20/a-question-of-memory-layout/#comment-169</link>
		<dc:creator>Vivek Ragunathan</dc:creator>
		<pubDate>Wed, 17 Feb 2010 12:35:04 +0000</pubDate>
		<guid isPermaLink="false">http://cplusplus.co.il/?p=813#comment-169</guid>
		<description>It is perceivable that the different versions of the classes above will result in different output. But isn&#039;t A* not the proper way of accessing in all cases?

C++ does not have an inherent array type, and we assume A* to be an array. Secondly, related to the intent of your post which is object layout, the user should be aware of what he is accessing.

Nice post!</description>
		<content:encoded><![CDATA[<p>It is perceivable that the different versions of the classes above will result in different output. But isn&#8217;t A* not the proper way of accessing in all cases?</p>
<p>C++ does not have an inherent array type, and we assume A* to be an array. Secondly, related to the intent of your post which is object layout, the user should be aware of what he is accessing.</p>
<p>Nice post!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rmn</title>
		<link>http://efesx.com/2010/01/20/a-question-of-memory-layout/#comment-168</link>
		<dc:creator>rmn</dc:creator>
		<pubDate>Fri, 22 Jan 2010 16:14:39 +0000</pubDate>
		<guid isPermaLink="false">http://cplusplus.co.il/?p=813#comment-168</guid>
		<description>Good suggestion! I&#039;ll add this to my TODO list :)

Thanks for the input.</description>
		<content:encoded><![CDATA[<p>Good suggestion! I&#8217;ll add this to my TODO list <img src='http://efesx.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Thanks for the input.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ofek</title>
		<link>http://efesx.com/2010/01/20/a-question-of-memory-layout/#comment-167</link>
		<dc:creator>Ofek</dc:creator>
		<pubDate>Thu, 21 Jan 2010 15:13:26 +0000</pubDate>
		<guid isPermaLink="false">http://cplusplus.co.il/?p=813#comment-167</guid>
		<description>Roman, you could devise an even nastier &#039;gotcha&#039; with virtual inheritance...   You can fiddle with the size of the virtual *base* table, as well as the virtual *function* table - as both precede the data members in the object memory layout.</description>
		<content:encoded><![CDATA[<p>Roman, you could devise an even nastier &#8216;gotcha&#8217; with virtual inheritance&#8230;   You can fiddle with the size of the virtual *base* table, as well as the virtual *function* table &#8211; as both precede the data members in the object memory layout.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nadav</title>
		<link>http://efesx.com/2010/01/20/a-question-of-memory-layout/#comment-166</link>
		<dc:creator>Nadav</dc:creator>
		<pubDate>Thu, 21 Jan 2010 13:49:15 +0000</pubDate>
		<guid isPermaLink="false">http://cplusplus.co.il/?p=813#comment-166</guid>
		<description>Ofek,  you bring a really good point. I looked at the compiled code and I was surprised to see the memory layout. After taking into account the fact that class &quot;A&quot; may not be modified, it does make sense. My mistake was that is a single virtual function is declared in the path, the entire path DOWNWARDS is declared virtual and not upwards, as we can see from this example. 

rmn, I really enjoyed this one!</description>
		<content:encoded><![CDATA[<p>Ofek,  you bring a really good point. I looked at the compiled code and I was surprised to see the memory layout. After taking into account the fact that class &#8220;A&#8221; may not be modified, it does make sense. My mistake was that is a single virtual function is declared in the path, the entire path DOWNWARDS is declared virtual and not upwards, as we can see from this example. </p>
<p>rmn, I really enjoyed this one!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ofek</title>
		<link>http://efesx.com/2010/01/20/a-question-of-memory-layout/#comment-165</link>
		<dc:creator>Ofek</dc:creator>
		<pubDate>Thu, 21 Jan 2010 07:06:29 +0000</pubDate>
		<guid isPermaLink="false">http://cplusplus.co.il/?p=813#comment-165</guid>
		<description>Nadav - I don&#039;t know what the standard has to say about this, but i do think such a compiler/linker design would be infeasible. A and B can be declared in different files - and in fact in different lib&#039;s altogether. When the compiler is faced with an &#039;A*&#039; argument, it has only A&#039;s type declaration to consult, and *not* its children.</description>
		<content:encoded><![CDATA[<p>Nadav &#8211; I don&#8217;t know what the standard has to say about this, but i do think such a compiler/linker design would be infeasible. A and B can be declared in different files &#8211; and in fact in different lib&#8217;s altogether. When the compiler is faced with an &#8216;A*&#8217; argument, it has only A&#8217;s type declaration to consult, and *not* its children.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nadav</title>
		<link>http://efesx.com/2010/01/20/a-question-of-memory-layout/#comment-164</link>
		<dc:creator>Nadav</dc:creator>
		<pubDate>Wed, 20 Jan 2010 21:20:43 +0000</pubDate>
		<guid isPermaLink="false">http://cplusplus.co.il/?p=813#comment-164</guid>
		<description>Hi RMN!

I am surprised that the second and the third definitions have a different output. To my understanding, once a single virtual function is declared in the path, the entire path becomes virtual, which means that the second example should be the same as the third. 

Nadav</description>
		<content:encoded><![CDATA[<p>Hi RMN!</p>
<p>I am surprised that the second and the third definitions have a different output. To my understanding, once a single virtual function is declared in the path, the entire path becomes virtual, which means that the second example should be the same as the third. </p>
<p>Nadav</p>
]]></content:encoded>
	</item>
</channel>
</rss>

