<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>内存对齐 on Kerolt's Note</title><link>https://kerolt.github.io/tags/%E5%86%85%E5%AD%98%E5%AF%B9%E9%BD%90/</link><description>Recent content in 内存对齐 on Kerolt's Note</description><generator>Hugo</generator><language>zh-cn</language><lastBuildDate>Tue, 22 Jul 2025 00:00:00 +0000</lastBuildDate><atom:link href="https://kerolt.github.io/tags/%E5%86%85%E5%AD%98%E5%AF%B9%E9%BD%90/index.xml" rel="self" type="application/rss+xml"/><item><title>关于内存对齐、位域的思考</title><link>https://kerolt.github.io/p/%E5%85%B3%E4%BA%8E%E5%86%85%E5%AD%98%E5%AF%B9%E9%BD%90%E4%BD%8D%E5%9F%9F%E7%9A%84%E6%80%9D%E8%80%83/</link><pubDate>Tue, 22 Jul 2025 00:00:00 +0000</pubDate><guid>https://kerolt.github.io/p/%E5%85%B3%E4%BA%8E%E5%86%85%E5%AD%98%E5%AF%B9%E9%BD%90%E4%BD%8D%E5%9F%9F%E7%9A%84%E6%80%9D%E8%80%83/</guid><description>&lt;h2 id="什么是内存对齐为什么需要它"&gt;什么是内存对齐？为什么需要它？&lt;/h2&gt;
&lt;p&gt;内存对齐（Memory Alignment）是计算机系统中数据在内存中存储的一种规则：​&lt;strong&gt;​数据在内存中的起始地址必须是其自身大小的整数倍​&lt;/strong&gt;​。例如，一个 4 字节的整型变量（&lt;code&gt;int&lt;/code&gt;），其起始地址必须是 4 的倍数（如地址 0x0000、0x0004、0x0008 等）。&lt;/p&gt;</description></item></channel></rss>