Skip to content

Commit 413aec8

Browse files
deploy: c98136e
1 parent 9936f85 commit 413aec8

4,221 files changed

Lines changed: 120750 additions & 115206 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

404.html

Lines changed: 8 additions & 2 deletions
Large diffs are not rendered by default.

appendix/index.html

Lines changed: 11 additions & 5 deletions
Large diffs are not rendered by default.

appendix/terminology.html

Lines changed: 11 additions & 5 deletions
Large diffs are not rendered by default.
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<mxfile host="app.diagrams.net">
2+
<diagram name="Process Memory Layout" id="process-memory-layout">
3+
<mxGraphModel dx="1200" dy="900" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
4+
<root>
5+
<mxCell id="0" />
6+
<mxCell id="1" parent="0" />
7+
<mxCell id="outer" value="" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=#222222;strokeWidth=2;fillColor=#ffffff;" vertex="1" parent="1">
8+
<mxGeometry x="250" y="80" width="330" height="660" as="geometry" />
9+
</mxCell>
10+
<mxCell id="high" value="高地址" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=#222222;strokeWidth=1;fillColor=#f5f5f5;fontSize=18;fontStyle=1;align=center;verticalAlign=middle;" vertex="1" parent="1">
11+
<mxGeometry x="250" y="80" width="330" height="60" as="geometry" />
12+
</mxCell>
13+
<mxCell id="stack" value="&lt;b&gt;Stack 栈&lt;/b&gt;&lt;br&gt;局部变量 / 函数调用帧&lt;br&gt;&lt;font color=&quot;#c00000&quot;&gt;↓ 向低地址增长&lt;/font&gt;" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=#222222;strokeWidth=1;fillColor=#ffe6e6;fontSize=16;align=center;verticalAlign=middle;spacing=8;" vertex="1" parent="1">
14+
<mxGeometry x="250" y="140" width="330" height="120" as="geometry" />
15+
</mxCell>
16+
<mxCell id="free" value="&lt;b&gt;未使用空间&lt;/b&gt;&lt;br&gt;堆和栈之间的弹性区域" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=#888888;strokeWidth=1;dashed=1;fillColor=#f2f2f2;fontSize=16;align=center;verticalAlign=middle;spacing=8;" vertex="1" parent="1">
17+
<mxGeometry x="250" y="260" width="330" height="100" as="geometry" />
18+
</mxCell>
19+
<mxCell id="heap" value="&lt;b&gt;Heap 堆&lt;/b&gt;&lt;br&gt;malloc / new 动态分配&lt;br&gt;&lt;font color=&quot;#008000&quot;&gt;↑ 向高地址增长&lt;/font&gt;" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=#222222;strokeWidth=1;fillColor=#e6f4ea;fontSize=16;align=center;verticalAlign=middle;spacing=8;" vertex="1" parent="1">
20+
<mxGeometry x="250" y="360" width="330" height="120" as="geometry" />
21+
</mxCell>
22+
<mxCell id="bss" value="&lt;b&gt;BSS 段&lt;/b&gt;&lt;br&gt;未初始化全局 / static 变量" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=#222222;strokeWidth=1;fillColor=#e8f0fe;fontSize=16;align=center;verticalAlign=middle;spacing=8;" vertex="1" parent="1">
23+
<mxGeometry x="250" y="480" width="330" height="90" as="geometry" />
24+
</mxCell>
25+
<mxCell id="data" value="&lt;b&gt;Data 段&lt;/b&gt;&lt;br&gt;已初始化全局 / static 变量" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=#222222;strokeWidth=1;fillColor=#e6f0ff;fontSize=16;align=center;verticalAlign=middle;spacing=8;" vertex="1" parent="1">
26+
<mxGeometry x="250" y="570" width="330" height="90" as="geometry" />
27+
</mxCell>
28+
<mxCell id="text" value="&lt;b&gt;Text 代码段&lt;/b&gt;&lt;br&gt;机器指令 / 只读常量" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=#222222;strokeWidth=1;fillColor=#fff2cc;fontSize=16;align=center;verticalAlign=middle;spacing=8;" vertex="1" parent="1">
29+
<mxGeometry x="250" y="660" width="330" height="90" as="geometry" />
30+
</mxCell>
31+
<mxCell id="low" value="低地址" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=#222222;strokeWidth=1;fillColor=#f5f5f5;fontSize=18;fontStyle=1;align=center;verticalAlign=middle;" vertex="1" parent="1">
32+
<mxGeometry x="250" y="750" width="330" height="60" as="geometry" />
33+
</mxCell>
34+
<mxCell id="heap-arrow" value="堆增长方向" style="endArrow=classic;html=1;rounded=0;strokeColor=#008000;strokeWidth=3;fontColor=#008000;fontSize=14;align=center;verticalAlign=middle;" edge="1" parent="1">
35+
<mxGeometry width="50" height="50" relative="1" as="geometry">
36+
<mxPoint x="620" y="460" as="sourcePoint" />
37+
<mxPoint x="620" y="380" as="targetPoint" />
38+
</mxGeometry>
39+
</mxCell>
40+
<mxCell id="stack-arrow" value="栈增长方向" style="endArrow=classic;html=1;rounded=0;strokeColor=#c00000;strokeWidth=3;fontColor=#c00000;fontSize=14;align=center;verticalAlign=middle;" edge="1" parent="1">
41+
<mxGeometry width="50" height="50" relative="1" as="geometry">
42+
<mxPoint x="620" y="160" as="sourcePoint" />
43+
<mxPoint x="620" y="240" as="targetPoint" />
44+
</mxGeometry>
45+
</mxCell>
46+
<mxCell id="title" value="进程虚拟地址空间示意图" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;fontSize=24;fontStyle=1;" vertex="1" parent="1">
47+
<mxGeometry x="215" y="35" width="400" height="40" as="geometry" />
48+
</mxCell>
49+
</root>
50+
</mxGraphModel>
51+
</diagram>
52+
</mxfile>
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<mxfile host="app.diagrams.net">
2+
<diagram name="AoS Layout" id="aos-layout">
3+
<mxGraphModel dx="1000" dy="600" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
4+
<root>
5+
<mxCell id="0" />
6+
<mxCell id="1" parent="0" />
7+
8+
<mxCell id="title" value="AoS 布局:每个元素的 x,y,z,r,g,b 紧挨在一起(24 字节)" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;fontSize=16;fontStyle=1;" vertex="1" parent="1">
9+
<mxGeometry x="80" y="30" width="500" height="30" as="geometry" />
10+
</mxCell>
11+
12+
<!-- Vertex 0 -->
13+
<mxCell id="v0x" value="x₀" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=#2E7D32;strokeWidth=1;fillColor=#C8E6C9;fontSize=13;align=center;verticalAlign=middle;" vertex="1" parent="1">
14+
<mxGeometry x="80" y="80" width="50" height="40" as="geometry" />
15+
</mxCell>
16+
<mxCell id="v0y" value="y₀" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=#2E7D32;strokeWidth=1;fillColor=#C8E6C9;fontSize=13;align=center;verticalAlign=middle;" vertex="1" parent="1">
17+
<mxGeometry x="130" y="80" width="50" height="40" as="geometry" />
18+
</mxCell>
19+
<mxCell id="v0z" value="z₀" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=#2E7D32;strokeWidth=1;fillColor=#C8E6C9;fontSize=13;align=center;verticalAlign=middle;" vertex="1" parent="1">
20+
<mxGeometry x="180" y="80" width="50" height="40" as="geometry" />
21+
</mxCell>
22+
<mxCell id="v0r" value="r₀" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=#C62828;strokeWidth=1;fillColor=#FFCDD2;fontSize=13;align=center;verticalAlign=middle;" vertex="1" parent="1">
23+
<mxGeometry x="230" y="80" width="50" height="40" as="geometry" />
24+
</mxCell>
25+
<mxCell id="v0g" value="g₀" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=#C62828;strokeWidth=1;fillColor=#FFCDD2;fontSize=13;align=center;verticalAlign=middle;" vertex="1" parent="1">
26+
<mxGeometry x="280" y="80" width="50" height="40" as="geometry" />
27+
</mxCell>
28+
<mxCell id="v0b" value="b₀" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=#C62828;strokeWidth=1;fillColor=#FFCDD2;fontSize=13;align=center;verticalAlign=middle;" vertex="1" parent="1">
29+
<mxGeometry x="330" y="80" width="50" height="40" as="geometry" />
30+
</mxCell>
31+
32+
<!-- Vertex 1 -->
33+
<mxCell id="v1x" value="x₁" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=#2E7D32;strokeWidth=1;fillColor=#C8E6C9;fontSize=13;align=center;verticalAlign=middle;" vertex="1" parent="1">
34+
<mxGeometry x="380" y="80" width="50" height="40" as="geometry" />
35+
</mxCell>
36+
<mxCell id="v1y" value="y₁" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=#2E7D32;strokeWidth=1;fillColor=#C8E6C9;fontSize=13;align=center;verticalAlign=middle;" vertex="1" parent="1">
37+
<mxGeometry x="430" y="80" width="50" height="40" as="geometry" />
38+
</mxCell>
39+
<mxCell id="v1z" value="z₁" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=#2E7D32;strokeWidth=1;fillColor=#C8E6C9;fontSize=13;align=center;verticalAlign=middle;" vertex="1" parent="1">
40+
<mxGeometry x="480" y="80" width="50" height="40" as="geometry" />
41+
</mxCell>
42+
<mxCell id="v1r" value="r₁" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=#C62828;strokeWidth=1;fillColor=#FFCDD2;fontSize=13;align=center;verticalAlign=middle;" vertex="1" parent="1">
43+
<mxGeometry x="530" y="80" width="50" height="40" as="geometry" />
44+
</mxCell>
45+
<mxCell id="v1g" value="g₁" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=#C62828;strokeWidth=1;fillColor=#FFCDD2;fontSize=13;align=center;verticalAlign=middle;" vertex="1" parent="1">
46+
<mxGeometry x="580" y="80" width="50" height="40" as="geometry" />
47+
</mxCell>
48+
<mxCell id="v1b" value="b₁" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=#C62828;strokeWidth=1;fillColor=#FFCDD2;fontSize=13;align=center;verticalAlign=middle;" vertex="1" parent="1">
49+
<mxGeometry x="630" y="80" width="50" height="40" as="geometry" />
50+
</mxCell>
51+
52+
<!-- Legend -->
53+
<mxCell id="legend_g" value="坐标数据(热路径)" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=#2E7D32;strokeWidth=1;fillColor=#C8E6C9;fontSize=11;align=center;verticalAlign=middle;" vertex="1" parent="1">
54+
<mxGeometry x="200" y="145" width="130" height="28" as="geometry" />
55+
</mxCell>
56+
<mxCell id="legend_r" value="颜色数据(冷路径)" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=#C62828;strokeWidth=1;fillColor=#FFCDD2;fontSize=11;align=center;verticalAlign=middle;" vertex="1" parent="1">
57+
<mxGeometry x="370" y="145" width="130" height="28" as="geometry" />
58+
</mxCell>
59+
60+
</root>
61+
</mxGraphModel>
62+
</diagram>
63+
</mxfile>
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<mxfile host="app.diagrams.net">
2+
<diagram name="SoA Layout" id="soa-layout">
3+
<mxGraphModel dx="1000" dy="600" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
4+
<root>
5+
<mxCell id="0" />
6+
<mxCell id="1" parent="0" />
7+
8+
<mxCell id="title" value="SoA 布局:所有 x 连续,所有 y 连续,以此类推" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;fontSize=16;fontStyle=1;" vertex="1" parent="1">
9+
<mxGeometry x="100" y="20" width="460" height="30" as="geometry" />
10+
</mxCell>
11+
12+
<!-- x array -->
13+
<mxCell id="xl" value="x[]" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=#2E7D32;strokeWidth=2;fillColor=#E8F5E9;fontSize=14;fontStyle=1;align=center;verticalAlign=middle;" vertex="1" parent="1">
14+
<mxGeometry x="80" y="70" width="50" height="35" as="geometry" />
15+
</mxCell>
16+
<mxCell id="x0" value="x₀" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=#2E7D32;strokeWidth=1;fillColor=#C8E6C9;fontSize=13;align=center;verticalAlign=middle;" vertex="1" parent="1">
17+
<mxGeometry x="130" y="70" width="50" height="35" as="geometry" />
18+
</mxCell>
19+
<mxCell id="x1" value="x₁" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=#2E7D32;strokeWidth=1;fillColor=#C8E6C9;fontSize=13;align=center;verticalAlign=middle;" vertex="1" parent="1">
20+
<mxGeometry x="180" y="70" width="50" height="35" as="geometry" />
21+
</mxCell>
22+
<mxCell id="x2" value="x₂" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=#2E7D32;strokeWidth=1;fillColor=#C8E6C9;fontSize=13;align=center;verticalAlign=middle;" vertex="1" parent="1">
23+
<mxGeometry x="230" y="70" width="50" height="35" as="geometry" />
24+
</mxCell>
25+
<mxCell id="xd" value="x₃ x₄ ..." style="rounded=0;whiteSpace=wrap;html=1;strokeColor=#2E7D32;strokeWidth=1;fillColor=#C8E6C9;fontSize=12;align=center;verticalAlign=middle;dashed=1;" vertex="1" parent="1">
26+
<mxGeometry x="280" y="70" width="100" height="35" as="geometry" />
27+
</mxCell>
28+
29+
<!-- y array -->
30+
<mxCell id="yl" value="y[]" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=#2E7D32;strokeWidth=2;fillColor=#E8F5E9;fontSize=14;fontStyle=1;align=center;verticalAlign=middle;" vertex="1" parent="1">
31+
<mxGeometry x="80" y="115" width="50" height="35" as="geometry" />
32+
</mxCell>
33+
<mxCell id="y0" value="y₀" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=#2E7D32;strokeWidth=1;fillColor=#C8E6C9;fontSize=13;align=center;verticalAlign=middle;" vertex="1" parent="1">
34+
<mxGeometry x="130" y="115" width="50" height="35" as="geometry" />
35+
</mxCell>
36+
<mxCell id="y1" value="y₁" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=#2E7D32;strokeWidth=1;fillColor=#C8E6C9;fontSize=13;align=center;verticalAlign=middle;" vertex="1" parent="1">
37+
<mxGeometry x="180" y="115" width="50" height="35" as="geometry" />
38+
</mxCell>
39+
<mxCell id="y2" value="y₂" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=#2E7D32;strokeWidth=1;fillColor=#C8E6C9;fontSize=13;align=center;verticalAlign=middle;" vertex="1" parent="1">
40+
<mxGeometry x="230" y="115" width="50" height="35" as="geometry" />
41+
</mxCell>
42+
<mxCell id="yd" value="y₃ y₄ ..." style="rounded=0;whiteSpace=wrap;html=1;strokeColor=#2E7D32;strokeWidth=1;fillColor=#C8E6C9;fontSize=12;align=center;verticalAlign=middle;dashed=1;" vertex="1" parent="1">
43+
<mxGeometry x="280" y="115" width="100" height="35" as="geometry" />
44+
</mxCell>
45+
46+
<!-- z array -->
47+
<mxCell id="zl" value="z[]" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=#2E7D32;strokeWidth=2;fillColor=#E8F5E9;fontSize=14;fontStyle=1;align=center;verticalAlign=middle;" vertex="1" parent="1">
48+
<mxGeometry x="80" y="160" width="50" height="35" as="geometry" />
49+
</mxCell>
50+
<mxCell id="z0" value="z₀" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=#2E7D32;strokeWidth=1;fillColor=#C8E6C9;fontSize=13;align=center;verticalAlign=middle;" vertex="1" parent="1">
51+
<mxGeometry x="130" y="160" width="50" height="35" as="geometry" />
52+
</mxCell>
53+
<mxCell id="z1" value="z₁" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=#2E7D32;strokeWidth=1;fillColor=#C8E6C9;fontSize=13;align=center;verticalAlign=middle;" vertex="1" parent="1">
54+
<mxGeometry x="180" y="160" width="50" height="35" as="geometry" />
55+
</mxCell>
56+
<mxCell id="z2" value="z₂" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=#2E7D32;strokeWidth=1;fillColor=#C8E6C9;fontSize=13;align=center;verticalAlign=middle;" vertex="1" parent="1">
57+
<mxGeometry x="230" y="160" width="50" height="35" as="geometry" />
58+
</mxCell>
59+
<mxCell id="zd" value="z₃ z₄ ..." style="rounded=0;whiteSpace=wrap;html=1;strokeColor=#2E7D32;strokeWidth=1;fillColor=#C8E6C9;fontSize=12;align=center;verticalAlign=middle;dashed=1;" vertex="1" parent="1">
60+
<mxGeometry x="280" y="160" width="100" height="35" as="geometry" />
61+
</mxCell>
62+
63+
</root>
64+
</mxGraphModel>
65+
</diagram>
66+
</mxfile>

0 commit comments

Comments
 (0)