<?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>《四谈内存对齐》的评论</title>
	<atom:link href="http://tonybai.com/2008/11/17/httptonybai-com20061208talk-about-memory-alignment-the-4th-time/feed/" rel="self" type="application/rss+xml" />
	<link>https://tonybai.com/2008/11/17/httptonybai-com20061208talk-about-memory-alignment-the-4th-time/</link>
	<description>一个程序员的心路历程</description>
	<lastBuildDate>Fri, 17 Apr 2026 15:31:53 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>作者：南阁-_-</title>
		<link>https://tonybai.com/2008/11/17/httptonybai-com20061208talk-about-memory-alignment-the-4th-time/#comment-1724</link>
		<dc:creator>南阁-_-</dc:creator>
		<pubDate>Fri, 09 Dec 2016 09:46:05 +0000</pubDate>
		<guid isPermaLink="false">http://tonybai.com/2008/11/17/%e5%9b%9b%e8%b0%88%e5%86%85%e5%ad%98%e5%af%b9%e9%bd%90/#comment-1724</guid>
		<description>感谢，大概了解了。 还是自己基础知识不够。。 汇编指令这些不懂。。</description>
		<content:encoded><![CDATA[<p>感谢，大概了解了。 还是自己基础知识不够。。 汇编指令这些不懂。。</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：bigwhite</title>
		<link>https://tonybai.com/2008/11/17/httptonybai-com20061208talk-about-memory-alignment-the-4th-time/#comment-1716</link>
		<dc:creator>bigwhite</dc:creator>
		<pubDate>Tue, 06 Dec 2016 08:56:12 +0000</pubDate>
		<guid isPermaLink="false">http://tonybai.com/2008/11/17/%e5%9b%9b%e8%b0%88%e5%86%85%e5%ad%98%e5%af%b9%e9%bd%90/#comment-1716</guid>
		<description>好久之前的文章了。我觉得你问的问题应该是编译器去解决的。cpu一次读取8个字节，我们实际上只要后4个字节，估计编译器在生成代码时，会通过相应指令只使用其后4个字节。比如，cpu一次从内存中读取8个字节放在rax寄存器(64位)中，但编译器通过ral和rah（32位)去访问rax中的32bit数据。(rax由rah+ral)组成.</description>
		<content:encoded><![CDATA[<p>好久之前的文章了。我觉得你问的问题应该是编译器去解决的。cpu一次读取8个字节，我们实际上只要后4个字节，估计编译器在生成代码时，会通过相应指令只使用其后4个字节。比如，cpu一次从内存中读取8个字节放在rax寄存器(64位)中，但编译器通过ral和rah（32位)去访问rax中的32bit数据。(rax由rah+ral)组成.</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：南阁-_-</title>
		<link>https://tonybai.com/2008/11/17/httptonybai-com20061208talk-about-memory-alignment-the-4th-time/#comment-1715</link>
		<dc:creator>南阁-_-</dc:creator>
		<pubDate>Tue, 06 Dec 2016 02:31:25 +0000</pubDate>
		<guid isPermaLink="false">http://tonybai.com/2008/11/17/%e5%9b%9b%e8%b0%88%e5%86%85%e5%ad%98%e5%af%b9%e9%bd%90/#comment-1715</guid>
		<description>但是如果这个地址只能被4整除，而不能被8整除(如地址12)，那么此时CPU读取的地址肯定是从Address_of_b – 4开始读取8个字节的，也就是说实际上CPU都是从能被8整除的地址上读取的，而且一次读了8个字节，b所在的位置恰是这个8个字节中的后4个字节，所以不存在触发core的可能。对上面这段话有个疑问： cpu读入8个字节后，是怎么去只去后四个字节的呢？</description>
		<content:encoded><![CDATA[<p>但是如果这个地址只能被4整除，而不能被8整除(如地址12)，那么此时CPU读取的地址肯定是从Address_of_b – 4开始读取8个字节的，也就是说实际上CPU都是从能被8整除的地址上读取的，而且一次读了8个字节，b所在的位置恰是这个8个字节中的后4个字节，所以不存在触发core的可能。对上面这段话有个疑问： cpu读入8个字节后，是怎么去只去后四个字节的呢？</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：jason</title>
		<link>https://tonybai.com/2008/11/17/httptonybai-com20061208talk-about-memory-alignment-the-4th-time/#comment-356</link>
		<dc:creator>jason</dc:creator>
		<pubDate>Wed, 18 Nov 2009 19:36:07 +0000</pubDate>
		<guid isPermaLink="false">http://tonybai.com/2008/11/17/%e5%9b%9b%e8%b0%88%e5%86%85%e5%ad%98%e5%af%b9%e9%bd%90/#comment-356</guid>
		<description>你好，你写的4篇文章不错。但我看了“Data alignment: Straighten up and fly right”，他所说的对齐是因为lazy procesor.而且对齐的工作是由编译器做的，在“Data alignment: Straighten up and fly right”文章中说明了所做的工作就是pad,就是填满不够对齐系数的部分，并且填充部分是不用的。你所说的方法有些复杂化得对齐的思想。呵呵，这只是个人想法。欢迎交流！</description>
		<content:encoded><![CDATA[<p>你好，你写的4篇文章不错。但我看了“Data alignment: Straighten up and fly right”，他所说的对齐是因为lazy procesor.而且对齐的工作是由编译器做的，在“Data alignment: Straighten up and fly right”文章中说明了所做的工作就是pad,就是填满不够对齐系数的部分，并且填充部分是不用的。你所说的方法有些复杂化得对齐的思想。呵呵，这只是个人想法。欢迎交流！</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：DLUT</title>
		<link>https://tonybai.com/2008/11/17/httptonybai-com20061208talk-about-memory-alignment-the-4th-time/#comment-357</link>
		<dc:creator>DLUT</dc:creator>
		<pubDate>Sun, 14 Jun 2009 10:15:23 +0000</pubDate>
		<guid isPermaLink="false">http://tonybai.com/2008/11/17/%e5%9b%9b%e8%b0%88%e5%86%85%e5%ad%98%e5%af%b9%e9%bd%90/#comment-357</guid>
		<description>从这学期学编译原理就开始看,一只看到期末备考,几篇关于内存对齐的文章终于被我看完了,呵呵,太谢谢你了,学到了很多东西~</description>
		<content:encoded><![CDATA[<p>从这学期学编译原理就开始看,一只看到期末备考,几篇关于内存对齐的文章终于被我看完了,呵呵,太谢谢你了,学到了很多东西~</p>
]]></content:encoded>
	</item>
</channel>
</rss>
