2026-02-01 16:00:12 +08:00
|
|
|
|
<mxfile host="65bd71144e">
|
|
|
|
|
|
<diagram id="5nK-vBOAah09B86iugSh" name="第 1 页">
|
2026-02-01 17:37:44 +08:00
|
|
|
|
<mxGraphModel dx="1134" dy="435" 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">
|
2026-02-01 16:00:12 +08:00
|
|
|
|
<root>
|
|
|
|
|
|
<mxCell id="0"/>
|
|
|
|
|
|
<mxCell id="1" parent="0"/>
|
|
|
|
|
|
<mxCell id="3" value="obj" style="ellipse;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
|
|
|
|
|
<mxGeometry x="80" y="230" width="120" height="80" as="geometry"/>
|
|
|
|
|
|
</mxCell>
|
|
|
|
|
|
<mxCell id="4" value="" style="shape=flexArrow;endArrow=classic;html=1;" edge="1" parent="1">
|
|
|
|
|
|
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
|
|
|
|
|
<mxPoint x="254" y="269.5" as="sourcePoint"/>
|
|
|
|
|
|
<mxPoint x="514" y="269.5" as="targetPoint"/>
|
|
|
|
|
|
</mxGeometry>
|
|
|
|
|
|
</mxCell>
|
|
|
|
|
|
<mxCell id="5" value="编码规则:<div>json</div>" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
|
|
|
|
|
|
<mxGeometry x="354" y="210" width="60" height="30" as="geometry"/>
|
|
|
|
|
|
</mxCell>
|
|
|
|
|
|
<mxCell id="7" value="bytes数组:<div>010101010</div>" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
|
|
|
|
|
<mxGeometry x="580" y="240" width="120" height="60" as="geometry"/>
|
|
|
|
|
|
</mxCell>
|
|
|
|
|
|
<mxCell id="8" value="" style="ellipse;shape=cloud;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
|
|
|
|
|
<mxGeometry x="580" y="370" width="120" height="80" as="geometry"/>
|
|
|
|
|
|
</mxCell>
|
|
|
|
|
|
<mxCell id="9" value="bytes数组:<div>010101010</div>" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
|
|
|
|
|
<mxGeometry x="580" y="510" width="120" height="60" as="geometry"/>
|
|
|
|
|
|
</mxCell>
|
|
|
|
|
|
<mxCell id="10" value="网线(0101)" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
|
|
|
|
|
|
<mxGeometry x="720" y="395" width="60" height="30" as="geometry"/>
|
|
|
|
|
|
</mxCell>
|
|
|
|
|
|
<mxCell id="11" value="" style="shape=flexArrow;endArrow=classic;html=1;" edge="1" parent="1">
|
|
|
|
|
|
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
|
|
|
|
|
<mxPoint x="550" y="540" as="sourcePoint"/>
|
|
|
|
|
|
<mxPoint x="220" y="540" as="targetPoint"/>
|
|
|
|
|
|
</mxGeometry>
|
|
|
|
|
|
</mxCell>
|
|
|
|
|
|
<mxCell id="12" value="obj" style="ellipse;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
|
|
|
|
|
<mxGeometry x="80" y="490" width="120" height="80" as="geometry"/>
|
|
|
|
|
|
</mxCell>
|
|
|
|
|
|
<mxCell id="13" value="编码规则:<div>json</div>" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
|
|
|
|
|
|
<mxGeometry x="360" y="490" width="60" height="30" as="geometry"/>
|
|
|
|
|
|
</mxCell>
|
|
|
|
|
|
<mxCell id="14" value="序列化" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
|
|
|
|
|
|
<mxGeometry x="354" y="280" width="60" height="30" as="geometry"/>
|
|
|
|
|
|
</mxCell>
|
|
|
|
|
|
<mxCell id="15" value="反序列" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
|
|
|
|
|
|
<mxGeometry x="360" y="555" width="60" height="30" as="geometry"/>
|
|
|
|
|
|
</mxCell>
|
|
|
|
|
|
<mxCell id="16" value="Actor" style="shape=umlActor;verticalLabelPosition=bottom;verticalAlign=top;html=1;outlineConnect=0;" vertex="1" parent="1">
|
|
|
|
|
|
<mxGeometry x="340" y="70" width="30" height="60" as="geometry"/>
|
|
|
|
|
|
</mxCell>
|
|
|
|
|
|
<mxCell id="17" value="字符串" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
|
|
|
|
|
<mxGeometry x="580" y="80" width="120" height="60" as="geometry"/>
|
|
|
|
|
|
</mxCell>
|
|
|
|
|
|
<mxCell id="18" value="" style="shape=flexArrow;endArrow=classic;html=1;" edge="1" parent="1">
|
|
|
|
|
|
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
|
|
|
|
|
<mxPoint x="640" y="220" as="sourcePoint"/>
|
|
|
|
|
|
<mxPoint x="640" y="160" as="targetPoint"/>
|
|
|
|
|
|
</mxGeometry>
|
|
|
|
|
|
</mxCell>
|
|
|
|
|
|
<mxCell id="19" value="字符解码" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
|
|
|
|
|
|
<mxGeometry x="680" y="180" width="60" height="30" as="geometry"/>
|
|
|
|
|
|
</mxCell>
|
|
|
|
|
|
<mxCell id="20" value="unicode<div><div>utf-8&nbsp;</div></div>" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
|
|
|
|
|
|
<mxGeometry x="560" y="180" width="60" height="40" as="geometry"/>
|
|
|
|
|
|
</mxCell>
|
|
|
|
|
|
<mxCell id="21" value="" style="shape=flexArrow;endArrow=classic;html=1;" edge="1" parent="1">
|
|
|
|
|
|
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
|
|
|
|
|
<mxPoint x="430" y="120" as="sourcePoint"/>
|
|
|
|
|
|
<mxPoint x="560" y="120" as="targetPoint"/>
|
|
|
|
|
|
</mxGeometry>
|
|
|
|
|
|
</mxCell>
|
2026-02-01 17:37:44 +08:00
|
|
|
|
<mxCell id="22" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
|
|
|
|
|
<mxGeometry x="100" y="720" width="120" height="250" as="geometry"/>
|
|
|
|
|
|
</mxCell>
|
|
|
|
|
|
<mxCell id="23" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
|
|
|
|
|
<mxGeometry x="350" y="720" width="120" height="250" as="geometry"/>
|
|
|
|
|
|
</mxCell>
|
|
|
|
|
|
<mxCell id="24" value="堆: Heap<div><br></div><div>灵活(复杂)</div>" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
|
|
|
|
|
|
<mxGeometry x="384" y="660" width="60" height="50" as="geometry"/>
|
|
|
|
|
|
</mxCell>
|
|
|
|
|
|
<mxCell id="25" value="栈 : Stack<div><br></div><div>高效(基础值)</div>" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
|
|
|
|
|
|
<mxGeometry x="120" y="660" width="80" height="50" as="geometry"/>
|
|
|
|
|
|
</mxCell>
|
|
|
|
|
|
<mxCell id="26" value="fn a" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
|
|
|
|
|
<mxGeometry x="100" y="920" width="120" height="30" as="geometry"/>
|
|
|
|
|
|
</mxCell>
|
|
|
|
|
|
<mxCell id="27" value="fn b" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
|
|
|
|
|
<mxGeometry x="100" y="890" width="120" height="30" as="geometry"/>
|
|
|
|
|
|
</mxCell>
|
|
|
|
|
|
<mxCell id="34" style="edgeStyle=none;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="28" target="30">
|
|
|
|
|
|
<mxGeometry relative="1" as="geometry"/>
|
|
|
|
|
|
</mxCell>
|
|
|
|
|
|
<mxCell id="35" value="变量提升" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="34">
|
|
|
|
|
|
<mxGeometry x="0.1077" y="-3" relative="1" as="geometry">
|
|
|
|
|
|
<mxPoint as="offset"/>
|
|
|
|
|
|
</mxGeometry>
|
|
|
|
|
|
</mxCell>
|
|
|
|
|
|
<mxCell id="28" value="fn c (数据 v)" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
|
|
|
|
|
<mxGeometry x="100" y="860" width="120" height="30" as="geometry"/>
|
|
|
|
|
|
</mxCell>
|
|
|
|
|
|
<mxCell id="29" value="<pre style="box-sizing: border-box; overflow: auto; font-family: SFMono-Regular, Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Courier New&quot;, monospace; font-size: 14px; margin-top: 0px; margin-bottom: 16px; overflow-wrap: normal; padding: 16px; line-height: 1.45; background-color: rgb(246, 248, 250); border-radius: 3px; min-height: 52px; tab-size: 4; color: rgb(64, 72, 91); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><code class="hljs hljs-go" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, &quot;Liberation Mono&quot;, &quot;Courier New&quot;, monospace; display: inline; overflow: visible; padding: 0px; color: rgba(0, 0, 0, 0.8); background: transparent; text-size-adjust: none; font-size: 14px; margin: 0px; border-radius: 6px; border: 0px; white-space: pre; font-weight: normal; word-break: normal; line-height: inherit; overflow-wrap: normal;"><span class="hljs-function" style="box-sizing: border-box;"><span class="hljs-keyword" style="box-sizing: border-box; color: rgb(51, 51, 51); font-weight: bold;">func</span> <span class="hljs-title" style="box-sizing: border-box; color: rgb(153, 0, 0); font-weight: bold;">getPtr</span><span class="hljs-params" style="box-sizing: border-box;">()</span> *<span class="hljs-title" style="box-sizing: border-box; color: rgb(153, 0, 0); font-weight: bold;">int</span></span> {
 v := <span class="hljs-number" style="box-sizing: border-box; color: rgb(0, 128, 128);">10</span>
 <span class="hljs-keyword" style="box-sizing: border-box; color: rgb(51, 51, 51); font-weight: bold;">return</span> &amp;v <span class="hljs-comment" style="box-sizing: border-box; color: rgb(153, 153, 136); font-style: italic;">// v 虽然是局部变量,但 Go 会自动提升到堆</span>
}</code></pre>" style="text;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
|
|
|
|
|
<mxGeometry x="40" y="990" width="490" height="150" as="geometry"/>
|
|
|
|
|
|
</mxCell>
|
|
|
|
|
|
<mxCell id="30" value="v" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
|
|
|
|
|
<mxGeometry x="350" y="860" width="120" height="30" as="geometry"/>
|
|
|
|
|
|
</mxCell>
|
|
|
|
|
|
<mxCell id="36" style="edgeStyle=none;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.25;entryDx=0;entryDy=0;" edge="1" parent="1" source="31" target="30">
|
|
|
|
|
|
<mxGeometry relative="1" as="geometry"/>
|
|
|
|
|
|
</mxCell>
|
|
|
|
|
|
<mxCell id="31" value="ptr" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
|
|
|
|
|
<mxGeometry x="100" y="800" width="120" height="30" as="geometry"/>
|
|
|
|
|
|
</mxCell>
|
|
|
|
|
|
<mxCell id="33" style="edgeStyle=none;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;" edge="1" parent="1" source="32" target="31">
|
|
|
|
|
|
<mxGeometry relative="1" as="geometry"/>
|
|
|
|
|
|
</mxCell>
|
|
|
|
|
|
<mxCell id="32" value="struct" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
|
|
|
|
|
<mxGeometry x="350" y="780" width="120" height="30" as="geometry"/>
|
|
|
|
|
|
</mxCell>
|
2026-02-01 16:00:12 +08:00
|
|
|
|
</root>
|
|
|
|
|
|
</mxGraphModel>
|
|
|
|
|
|
</diagram>
|
|
|
|
|
|
</mxfile>
|