<mxfile host="app.diagrams.net" agent="Claude Code">
  <diagram id="malloc-flow" name="malloc流程">
    <mxGraphModel dx="2618" dy="424" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1800" pageHeight="3600" background="light-dark(#ffffff, #121212)" math="0" shadow="0">
      <root>
        <mxCell id="0" />
        <mxCell id="1" parent="0" />
        <mxCell id="TITLE" parent="1" style="text;html=1;align=center;verticalAlign=middle;fontStyle=1;fontSize=17;" value="malloc 源码执行流程总览（依据 __libc_malloc / _int_malloc / malloc_consolidate）" vertex="1">
          <mxGeometry height="30" width="900" x="20" as="geometry" />
        </mxCell>
        <mxCell id="SH1" parent="1" style="text;html=1;align=left;verticalAlign=middle;fontStyle=1;fontSize=14;fontColor=#1f4e79;" value="① __libc_malloc(bytes) —— 分配入口" vertex="1">
          <mxGeometry height="28" width="260" x="20" y="45" as="geometry" />
        </mxCell>
        <mxCell id="L0" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;" value="用户调用 malloc(bytes)" vertex="1">
          <mxGeometry height="40" width="180" x="40" y="80" as="geometry" />
        </mxCell>
        <mxCell id="L1" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" value="读取 __malloc_hook&lt;br&gt;（原子读取）" vertex="1">
          <mxGeometry height="50" width="180" x="40" y="150" as="geometry" />
        </mxCell>
        <mxCell id="L2" parent="1" style="rhombus;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" value="hook != NULL ?" vertex="1">
          <mxGeometry height="70" width="200" x="30" y="230" as="geometry" />
        </mxCell>
        <mxCell id="L3" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" value="调用 __malloc_hook(bytes, 返回地址)&lt;br&gt;并返回其结果" vertex="1">
          <mxGeometry height="60" width="200" x="300" y="240" as="geometry" />
        </mxCell>
        <mxCell id="L4" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" value="arena_get&lt;br&gt;获取本线程对应 thread_arena" vertex="1">
          <mxGeometry height="50" width="180" x="40" y="340" as="geometry" />
        </mxCell>
        <mxCell id="L5" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" value="调用 _int_malloc(ar_ptr, bytes)" vertex="1">
          <mxGeometry height="50" width="180" x="40" y="430" as="geometry" />
        </mxCell>
        <mxCell id="L6" parent="1" style="rhombus;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" value="victim==NULL 且&lt;br&gt;ar_ptr != NULL ?" vertex="1">
          <mxGeometry height="70" width="200" x="30" y="520" as="geometry" />
        </mxCell>
        <mxCell id="L7" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" value="arena_get_retry&lt;br&gt;获取下一个分配区&lt;br&gt;再次调用 _int_malloc" vertex="1">
          <mxGeometry height="70" width="200" x="300" y="530" as="geometry" />
        </mxCell>
        <mxCell id="L8" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" value="mutex_unlock&lt;br&gt;释放分配区锁" vertex="1">
          <mxGeometry height="50" width="180" x="40" y="640" as="geometry" />
        </mxCell>
        <mxCell id="L9" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;" value="返回 victim" vertex="1">
          <mxGeometry height="40" width="180" x="40" y="730" as="geometry" />
        </mxCell>
        <mxCell id="SH2" parent="1" style="text;html=1;align=left;verticalAlign=middle;fontStyle=1;fontSize=14;fontColor=#1f4e79;" value="② _int_malloc(av, bytes) —— 主流程" vertex="1">
          <mxGeometry height="28" width="260" x="20" y="800" as="geometry" />
        </mxCell>
        <mxCell id="M0" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;" value="进入 _int_malloc(av, bytes)" vertex="1">
          <mxGeometry height="40" width="180" x="40" y="850" as="geometry" />
        </mxCell>
        <mxCell id="M1" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" value="checked_request2size&lt;br&gt;计算 chunk_size nb" vertex="1">
          <mxGeometry height="50" width="180" x="40" y="920" as="geometry" />
        </mxCell>
        <mxCell id="M2" parent="1" style="rhombus;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" value="av == NULL ?&lt;br&gt;（无可用分配区）" vertex="1">
          <mxGeometry height="70" width="200" x="30" y="1010" as="geometry" />
        </mxCell>
        <mxCell id="M3" parent="1" style="shape=parallelogram;whiteSpace=wrap;html=1;fillColor=#ffe6cc;strokeColor=#d79b00;" value="sysmalloc(nb, av)&lt;br&gt;alloc_perturb → 返回 p" vertex="1">
          <mxGeometry height="60" width="200" x="300" y="1020" as="geometry" />
        </mxCell>
        <mxCell id="M4" parent="1" style="rhombus;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" value="nb &lt;= get_max_fast() ?&lt;br&gt;（请求在 fastbin 范围）" vertex="1">
          <mxGeometry height="70" width="200" x="30" y="1120" as="geometry" />
        </mxCell>
        <mxCell id="FB1" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" value="idx = fastbin_index(nb)&lt;br&gt;fb = &amp;fastbin(av, idx)" vertex="1">
          <mxGeometry height="60" width="210" x="340" y="1130" as="geometry" />
        </mxCell>
        <mxCell id="FB2" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" value="CAS 原子操作取出链头 chunk&lt;br&gt;victim = 原 fb 头部（lock-free）" vertex="1">
          <mxGeometry height="60" width="210" x="340" y="1220" as="geometry" />
        </mxCell>
        <mxCell id="FB3" parent="1" style="rhombus;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" value="victim != 0 ?&lt;br&gt;（fastbin 存在空闲 chunk）" vertex="1">
          <mxGeometry height="70" width="210" x="340" y="1320" as="geometry" />
        </mxCell>
        <mxCell id="FB4" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" value="校验 victim 的 size 与 bin index 匹配&lt;br&gt;（memory corruption 检查）&lt;br&gt;返回 chunk2mem(victim)&lt;br&gt;（从 fastbin 头部取出）" vertex="1">
          <mxGeometry height="80" width="210" x="1150" y="1330" as="geometry" />
        </mxCell>
        <mxCell id="SB1" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" value="idx = smallbin_index(nb)&lt;br&gt;bin = bin_at(av, idx)" vertex="1">
          <mxGeometry height="60" width="200" x="620" y="1300" as="geometry" />
        </mxCell>
        <mxCell id="SB2" parent="1" style="rhombus;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" value="last(bin) != bin ?&lt;br&gt;（该 smallbin 表非空）" vertex="1">
          <mxGeometry height="70" width="200" x="620" y="1400" as="geometry" />
        </mxCell>
        <mxCell id="SB3" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" value="双向链表一致性校验&lt;br&gt;last(bin)-&gt;bk-&gt;fd == last(bin)&lt;br&gt;从链表尾部取出 victim&lt;br&gt;置 inuse 标志，返回 chunk2mem(victim)" vertex="1">
          <mxGeometry height="90" width="210" x="1150" y="1420" as="geometry" />
        </mxCell>
        <mxCell id="M5" parent="1" style="rhombus;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" value="in_smallbin_range(nb) ?&lt;br&gt;（请求在 smallbin 范围）" vertex="1">
          <mxGeometry height="70" width="200" x="30" y="1250" as="geometry" />
        </mxCell>
        <mxCell id="M6" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" value="idx = largebin_index(nb)&lt;br&gt;（请求在 largebin 范围）" vertex="1">
          <mxGeometry height="50" width="200" x="30" y="1390" as="geometry" />
        </mxCell>
        <mxCell id="M7" parent="1" style="rhombus;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" value="have_fastchunks(av) ?" vertex="1">
          <mxGeometry height="70" width="200" x="30" y="1480" as="geometry" />
        </mxCell>
        <mxCell id="M8" parent="1" style="shape=parallelogram;whiteSpace=wrap;html=1;fillColor=#ffe6cc;strokeColor=#d79b00;" value="malloc_consolidate(av)&lt;br&gt;合并 fastbin → unsorted_bin" vertex="1">
          <mxGeometry height="60" width="200" x="300" y="1490" as="geometry" />
        </mxCell>
        <mxCell id="NOTET" parent="1" style="text;html=1;align=left;verticalAlign=middle;fontStyle=2;fontColor=#666666;" value="注：此处展示的是较旧 glibc 的源码，代码块中未含 tcache 逻辑；&lt;div&gt;tcache 取块/填充只出现在文首文字概述中。&lt;/div&gt;" vertex="1">
          <mxGeometry height="34" width="560" x="280" y="1586" as="geometry" />
        </mxCell>
        <mxCell id="NOTES" parent="1" style="text;html=1;align=left;verticalAlign=middle;fontStyle=2;fontColor=#666666;" value="注：若 smallbin 尚未初始化为双向循环链表（victim==0），会先调用 malloc_consolidate 完成初始化。" vertex="1">
          <mxGeometry height="34" width="520" x="620" y="1540" as="geometry" />
        </mxCell>
        <mxCell id="LP0" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" value="for (;;) 大循环&lt;br&gt;iters = 0" vertex="1">
          <mxGeometry height="50" width="200" x="30" y="1620" as="geometry" />
        </mxCell>
        <mxCell id="LP1" parent="1" style="rhombus;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" value="unsorted_bin 非空 ?&lt;br&gt;（victim = 链尾最后一个 chunk）" vertex="1">
          <mxGeometry height="70" width="200" x="30" y="1710" as="geometry" />
        </mxCell>
        <mxCell id="U1" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" value="victim = unsorted_bin 链尾 chunk&lt;br&gt;bck = victim-&gt;bk（倒数第二个）" vertex="1">
          <mxGeometry height="60" width="210" x="340" y="1720" as="geometry" />
        </mxCell>
        <mxCell id="U2" parent="1" style="rhombus;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" value="victim-&gt;size 合法 ?&lt;br&gt;（&gt; 2*SIZE_SZ 且 &lt;= system_mem）" vertex="1">
          <mxGeometry height="70" width="210" x="340" y="1820" as="geometry" />
        </mxCell>
        <mxCell id="U3" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;" value="malloc_printerr&lt;br&gt;（memory corruption）" vertex="1">
          <mxGeometry height="60" width="210" x="880" y="1830" as="geometry" />
        </mxCell>
        <mxCell id="U4" parent="1" style="rhombus;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" value="请求为 smallbin &amp;&amp;&lt;br&gt;victim == last_remainder &amp;&amp;&lt;br&gt;unsorted 中唯一 &amp;&amp;&lt;br&gt;size &gt; nb + MINSIZE ?" vertex="1">
          <mxGeometry height="90" width="210" x="340" y="1930" as="geometry" />
        </mxCell>
        <mxCell id="U5" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" value="从 last_remainder 切出 nb 大小&lt;br&gt;remainder 作为 unsorted 唯一 chunk&lt;br&gt;更新 last_remainder&lt;br&gt;设置头部标志 → 返回 chunk" vertex="1">
          <mxGeometry height="110" width="210" x="880" y="1930" as="geometry" />
        </mxCell>
        <mxCell id="U6" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" value="将 victim 从 unsorted_bin 取出&lt;br&gt;（unsorted_bin-&gt;bk = bck）" vertex="1">
          <mxGeometry height="60" width="210" x="340" y="2070" as="geometry" />
        </mxCell>
        <mxCell id="U7" parent="1" style="rhombus;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" value="size == nb ?&lt;br&gt;（大小恰好相等）" vertex="1">
          <mxGeometry height="70" width="210" x="340" y="2170" as="geometry" />
        </mxCell>
        <mxCell id="U8" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" value="置 inuse 标志&lt;br&gt;直接返回 chunk2mem(victim)" vertex="1">
          <mxGeometry height="60" width="210" x="880" y="2180" as="geometry" />
        </mxCell>
        <mxCell id="U9" parent="1" style="rhombus;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" value="in_smallbin_range(size) ?&lt;br&gt;（victim 大小分桶）" vertex="1">
          <mxGeometry height="70" width="210" x="340" y="2280" as="geometry" />
        </mxCell>
        <mxCell id="U10" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" value="插入 smallbin 链表头部&lt;br&gt;（bck=表头，fwd=首 chunk&lt;br&gt;victim 插入两者之间）" vertex="1">
          <mxGeometry height="90" width="210" x="880" y="2290" as="geometry" />
        </mxCell>
        <mxCell id="U11" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" value="插入 largebin（按大小有序）：&lt;br&gt;· 比链尾小 → 插链表尾部&lt;br&gt;· 否则正向遍历 fd_nextsize&lt;br&gt;· 同大小 → 加在首个相等&lt;br&gt;  chunk 后面&lt;br&gt;· 否则插合适位置并&lt;br&gt;  更新 nextsize 链表" vertex="1">
          <mxGeometry height="140" width="210" x="880" y="2420" as="geometry" />
        </mxCell>
        <mxCell id="U12" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" value="mark_bin 置位&lt;br&gt;将 victim 插入对应 bin" vertex="1">
          <mxGeometry height="60" width="210" x="340" y="2430" as="geometry" />
        </mxCell>
        <mxCell id="U13" parent="1" style="rhombus;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" value="++iters &gt;= MAX_ITERS&lt;br&gt;（10000）？" vertex="1">
          <mxGeometry height="70" width="210" x="340" y="2530" as="geometry" />
        </mxCell>
        <mxCell id="U14" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" value="break 退出 unsorted 遍历" vertex="1">
          <mxGeometry height="50" width="210" x="340" y="2640" as="geometry" />
        </mxCell>
        <mxCell id="LG1" parent="1" style="rhombus;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" value="largebin 非空且&lt;br&gt;最大 chunk &gt;= nb ?" vertex="1">
          <mxGeometry height="70" width="200" x="620" y="1900" as="geometry" />
        </mxCell>
        <mxCell id="LG2" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" value="victim = victim-&gt;bk_nextsize&lt;br&gt;反向遍历 chunk size 链表&lt;br&gt;找第一个 &gt;= nb 的 chunk" vertex="1">
          <mxGeometry height="70" width="200" x="620" y="2010" as="geometry" />
        </mxCell>
        <mxCell id="LG3" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" value="存在多个同大小 chunk ?&lt;br&gt;取第二个（victim-&gt;fd）&lt;br&gt;避免 unlink 修改 nextsize" vertex="1">
          <mxGeometry height="80" width="200" x="620" y="2120" as="geometry" />
        </mxCell>
        <mxCell id="LG4" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" value="unlink 将 victim 从 largebin 取出" vertex="1">
          <mxGeometry height="50" width="200" x="620" y="2240" as="geometry" />
        </mxCell>
        <mxCell id="LG5" parent="1" style="rhombus;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" value="remainder_size &gt;= MINSIZE ?" vertex="1">
          <mxGeometry height="70" width="200" x="620" y="2330" as="geometry" />
        </mxCell>
        <mxCell id="LG6" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" value="切分出 nb&lt;br&gt;remainder 加入 unsorted_bin 头部&lt;br&gt;设置头部标志&lt;br&gt;返回 victim" vertex="1">
          <mxGeometry height="90" width="210" x="1150" y="2340" as="geometry" />
        </mxCell>
        <mxCell id="LG7" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" value="整个 victim 返回&lt;br&gt;（实际分配略大于请求）" vertex="1">
          <mxGeometry height="60" width="210" x="1150" y="2470" as="geometry" />
        </mxCell>
        <mxCell id="LP11" parent="1" style="rhombus;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" value="!in_smallbin_range(nb) ?&lt;br&gt;（请求属于 largebin）" vertex="1">
          <mxGeometry height="70" width="200" x="30" y="1860" as="geometry" />
        </mxCell>
        <mxCell id="LP12" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" value="++idx&lt;br&gt;block / map / bit 定位&lt;br&gt;（binmap 加速查找）" vertex="1">
          <mxGeometry height="60" width="200" x="30" y="1990" as="geometry" />
        </mxCell>
        <mxCell id="LP13" parent="1" style="rhombus;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" value="当前 block 内&lt;br&gt;存在非空 bin ?（bit &amp; map）" vertex="1">
          <mxGeometry height="70" width="200" x="30" y="2090" as="geometry" />
        </mxCell>
        <mxCell id="LP15" parent="1" style="rhombus;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" value="遍历完所有 block ?" vertex="1">
          <mxGeometry height="70" width="200" x="30" y="2200" as="geometry" />
        </mxCell>
        <mxCell id="LP16" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" value="定位到含空闲 chunk 的 bin&lt;br&gt;victim = last(bin) 链尾" vertex="1">
          <mxGeometry height="50" width="200" x="30" y="2300" as="geometry" />
        </mxCell>
        <mxCell id="LP17" parent="1" style="rhombus;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" value="victim == bin ?&lt;br&gt;（该 bin 实际为空）" vertex="1">
          <mxGeometry height="70" width="200" x="30" y="2390" as="geometry" />
        </mxCell>
        <mxCell id="LP18" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" value="binmap 相应 bit 清零&lt;br&gt;取下一个 bin（bit&lt;&lt;1）" vertex="1">
          <mxGeometry height="60" width="200" x="250" y="2350" as="geometry" />
        </mxCell>
        <mxCell id="LP19" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" value="unlink 取出 victim&lt;br&gt;计算 remainder_size" vertex="1">
          <mxGeometry height="60" width="200" x="30" y="2500" as="geometry" />
        </mxCell>
        <mxCell id="LP20" parent="1" style="rhombus;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" value="remainder_size &lt; MINSIZE ?" vertex="1">
          <mxGeometry height="70" width="200" x="30" y="2600" as="geometry" />
        </mxCell>
        <mxCell id="LP21" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" value="整个 victim 返回" vertex="1">
          <mxGeometry height="60" width="200" x="320" y="2750" as="geometry" />
        </mxCell>
        <mxCell id="LP22" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" value="切分出 nb&lt;br&gt;remainder 加入 unsorted_bin 头部&lt;br&gt;（smallbin 请求则更新 last_remainder）&lt;br&gt;返回 victim" vertex="1">
          <mxGeometry height="90" width="200" x="30" y="2710" as="geometry" />
        </mxCell>
        <mxCell id="LP23" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" value="use_top：victim = av-&gt;top" vertex="1">
          <mxGeometry height="50" width="200" x="30" y="2870" as="geometry" />
        </mxCell>
        <mxCell id="LP24" parent="1" style="rhombus;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" value="size &gt;= nb + MINSIZE ?&lt;br&gt;（top 足够切分）" vertex="1">
          <mxGeometry height="70" width="200" x="30" y="2960" as="geometry" />
        </mxCell>
        <mxCell id="LP25" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" value="从 top 切分出 nb&lt;br&gt;剩余作为新 top（fencepost）&lt;br&gt;返回 victim" vertex="1">
          <mxGeometry height="70" width="200" x="30" y="3070" as="geometry" />
        </mxCell>
        <mxCell id="LP26" parent="1" style="rhombus;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" value="have_fastchunks(av) ?" vertex="1">
          <mxGeometry height="70" width="200" x="30" y="3180" as="geometry" />
        </mxCell>
        <mxCell id="LP27" parent="1" style="shape=parallelogram;whiteSpace=wrap;html=1;fillColor=#ffe6cc;strokeColor=#d79b00;" value="malloc_consolidate(av)&lt;br&gt;重新设置 bin index&lt;br&gt;continue 回大循环" vertex="1">
          <mxGeometry height="70" width="200" x="300" y="3190" as="geometry" />
        </mxCell>
        <mxCell id="LP28" parent="1" style="shape=parallelogram;whiteSpace=wrap;html=1;fillColor=#ffe6cc;strokeColor=#d79b00;" value="sysmalloc(nb, av)&lt;br&gt;向系统申请新内存&lt;br&gt;返回 chunk" vertex="1">
          <mxGeometry height="70" width="200" x="30" y="3290" as="geometry" />
        </mxCell>
        <mxCell id="SH3" parent="1" style="text;html=1;align=left;verticalAlign=middle;fontStyle=1;fontSize=14;fontColor=#1f4e79;" value="③ malloc_consolidate(av) —— 合并 fastbin 空闲块" vertex="1">
          <mxGeometry height="28" width="300" x="1440" y="1570" as="geometry" />
        </mxCell>
        <mxCell id="C0" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;" value="malloc_consolidate(av)" vertex="1">
          <mxGeometry height="40" width="200" x="1440" y="1620" as="geometry" />
        </mxCell>
        <mxCell id="C1" parent="1" style="rhombus;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" value="get_max_fast() != 0 ?&lt;br&gt;（ptmalloc 已初始化）" vertex="1">
          <mxGeometry height="70" width="200" x="1440" y="1700" as="geometry" />
        </mxCell>
        <mxCell id="C2" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" value="malloc_init_state(av)&lt;br&gt;初始化分配区" vertex="1">
          <mxGeometry height="60" width="200" x="1680" y="1710" as="geometry" />
        </mxCell>
        <mxCell id="C3" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" value="clear_fastchunks(av)&lt;br&gt;获取 unsorted_bin 表头" vertex="1">
          <mxGeometry height="50" width="200" x="1440" y="1810" as="geometry" />
        </mxCell>
        <mxCell id="C4" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" value="遍历 fastbin&lt;br&gt;（fb = 0 → NFASTBINS-1）" vertex="1">
          <mxGeometry height="50" width="200" x="1440" y="1900" as="geometry" />
        </mxCell>
        <mxCell id="C5" parent="1" style="rhombus;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" value="当前 fastbin 链非空 ?&lt;br&gt;（p != 0）" vertex="1">
          <mxGeometry height="70" width="200" x="1440" y="1990" as="geometry" />
        </mxCell>
        <mxCell id="C6" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" value="遍历该链内 chunk&lt;br&gt;nextp = p-&gt;fd；取 size、nextchunk" vertex="1">
          <mxGeometry height="60" width="200" x="1440" y="2100" as="geometry" />
        </mxCell>
        <mxCell id="C7" parent="1" style="rhombus;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" value="前一个 chunk 空闲 ?&lt;br&gt;（!prev_inuse）" vertex="1">
          <mxGeometry height="70" width="200" x="1440" y="2200" as="geometry" />
        </mxCell>
        <mxCell id="C8" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" value="向前合并&lt;br&gt;size += prevsize&lt;br&gt;unlink 前一个 chunk" vertex="1">
          <mxGeometry height="70" width="200" x="1680" y="2210" as="geometry" />
        </mxCell>
        <mxCell id="C9" parent="1" style="rhombus;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" value="nextchunk == top ?&lt;br&gt;（下一个是 top chunk）" vertex="1">
          <mxGeometry height="70" width="200" x="1440" y="2310" as="geometry" />
        </mxCell>
        <mxCell id="C10" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" value="合并入 top chunk&lt;br&gt;av-&gt;top = p" vertex="1">
          <mxGeometry height="70" width="200" x="1680" y="2320" as="geometry" />
        </mxCell>
        <mxCell id="C11" parent="1" style="rhombus;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" value="下一个 chunk 空闲 ?&lt;br&gt;（inuse_bit_at_offset）" vertex="1">
          <mxGeometry height="70" width="200" x="1440" y="2420" as="geometry" />
        </mxCell>
        <mxCell id="C12" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" value="向后合并&lt;br&gt;size += nextsize&lt;br&gt;unlink nextchunk" vertex="1">
          <mxGeometry height="70" width="200" x="1680" y="2430" as="geometry" />
        </mxCell>
        <mxCell id="C13" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" value="清除下一个 chunk 的 inuse bit" vertex="1">
          <mxGeometry height="60" width="200" x="1680" y="2540" as="geometry" />
        </mxCell>
        <mxCell id="C14" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" value="合并后的 chunk 加入&lt;br&gt;unsorted_bin 双向链表头部" vertex="1">
          <mxGeometry height="70" width="200" x="1440" y="2540" as="geometry" />
        </mxCell>
        <mxCell id="C15" parent="1" style="rhombus;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" value="链内还有 chunk ?&lt;br&gt;（p = nextp）" vertex="1">
          <mxGeometry height="70" width="200" x="1440" y="2650" as="geometry" />
        </mxCell>
        <mxCell id="C16" parent="1" style="rhombus;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" value="fb++ 后还有未处理&lt;br&gt;的 fastbin ?" vertex="1">
          <mxGeometry height="70" width="200" x="1440" y="2760" as="geometry" />
        </mxCell>
        <mxCell id="C17" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;" value="返回" vertex="1">
          <mxGeometry height="40" width="200" x="1440" y="2870" as="geometry" />
        </mxCell>
        <mxCell id="LEG1" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" value="处理 / 操作" vertex="1">
          <mxGeometry height="30" width="130" x="60" y="3370" as="geometry" />
        </mxCell>
        <mxCell id="LEG2" parent="1" style="rhombus;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" value="条件判断" vertex="1">
          <mxGeometry height="30" width="130" x="220" y="3350" as="geometry" />
        </mxCell>
        <mxCell id="LEG3" parent="1" style="shape=parallelogram;whiteSpace=wrap;html=1;fillColor=#ffe6cc;strokeColor=#d79b00;" value="子程序 / 系统调用" vertex="1">
          <mxGeometry height="30" width="150" x="400" y="3350" as="geometry" />
        </mxCell>
        <mxCell id="LEG4" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;" value="错误处理" vertex="1">
          <mxGeometry height="30" width="130" x="600" y="3350" as="geometry" />
        </mxCell>
        <mxCell id="LEG5" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;" value="开始 / 结束" vertex="1">
          <mxGeometry height="30" width="130" x="780" y="3350" as="geometry" />
        </mxCell>
        <mxCell id="E1" edge="1" parent="1" source="L0" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="L1">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E2" edge="1" parent="1" source="L1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="L2">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E3" edge="1" parent="1" source="L2" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=1;exitY=0.5;entryX=0;entryY=0.5;" target="L3" value="是">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E4" edge="1" parent="1" source="L2" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="L4" value="否">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E5" edge="1" parent="1" source="L4" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="L5">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E6" edge="1" parent="1" source="L5" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="L6">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E7" edge="1" parent="1" source="L6" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=1;exitY=0.5;entryX=0;entryY=0.5;" target="L7" value="是">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E8" edge="1" parent="1" source="L6" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="L8" value="否">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E9" edge="1" parent="1" source="L7" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="L8">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E10" edge="1" parent="1" source="L8" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="L9">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E11" edge="1" parent="1" source="M0" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="M1">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E12" edge="1" parent="1" source="M1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="M2">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E13" edge="1" parent="1" source="M2" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=1;exitY=0.5;entryX=0;entryY=0.5;" target="M3" value="是">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E14" edge="1" parent="1" source="M2" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="M4" value="否">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E15" edge="1" parent="1" source="M4" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=1;exitY=0.5;entryX=0;entryY=0.5;" target="FB1" value="是">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E16" edge="1" parent="1" source="FB1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="FB2">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E17" edge="1" parent="1" source="FB2" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="FB3">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E18" edge="1" parent="1" source="FB3" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=1;exitY=0.5;entryX=0;entryY=0.5;" target="FB4" value="是">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E19" edge="1" parent="1" source="FB3" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="M5" value="否（fastbin 无空闲，向下）">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E20" edge="1" parent="1" source="M4" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="M5" value="否">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E21" edge="1" parent="1" source="M5" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=1;exitY=0.5;entryX=0;entryY=0.5;" target="SB1" value="是">
          <mxGeometry relative="1" x="-0.1495" as="geometry">
            <mxPoint as="offset" />
            <Array as="points">
              <mxPoint x="390" y="1285.04" />
              <mxPoint x="390" y="1330" />
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="E22" edge="1" parent="1" source="SB1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="SB2">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E23" edge="1" parent="1" source="SB2" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=1;exitY=0.5;entryX=0;entryY=0.5;" target="SB3" value="是">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E24" edge="1" parent="1" source="SB2" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="LP0" value="否（表空，向下进入 unsorted 循环）">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E25" edge="1" parent="1" source="M5" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="M6" value="否（largebin 范围）">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E26" edge="1" parent="1" source="M6" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="M7">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E27" edge="1" parent="1" source="M7" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=1;exitY=0.5;entryX=0;entryY=0.5;" target="M8" value="是">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E28" edge="1" parent="1" source="M7" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="LP0" value="否">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E29" edge="1" parent="1" source="M8" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="LP0">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E90" edge="1" parent="1" source="M8" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;dashed=1;strokeColor=#d79b00;labelBackgroundColor=#ffffff;exitX=1;exitY=0.5;entryX=0;entryY=0.5;" target="C0" value="调用">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E31" edge="1" parent="1" source="LP0" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="LP1">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E32" edge="1" parent="1" source="LP1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=1;exitY=0.5;entryX=0;entryY=0.5;" target="U1" value="是（取最后一个 chunk）">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E33" edge="1" parent="1" source="LP1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="LP11" value="否（处理完毕）">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E34" edge="1" parent="1" source="U1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="U2">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E35" edge="1" parent="1" source="U2" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=1;exitY=0.5;entryX=0;entryY=0.5;" target="U3" value="否（报错）">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E36" edge="1" parent="1" source="U2" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="U4" value="是">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E37" edge="1" parent="1" source="U4" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=1;exitY=0.5;entryX=0;entryY=0.5;" target="U5" value="是">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E38" edge="1" parent="1" source="U4" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="U6" value="否">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E39" edge="1" parent="1" source="U6" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="U7">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E40" edge="1" parent="1" source="U7" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=1;exitY=0.5;entryX=0;entryY=0.5;" target="U8" value="是">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E41" edge="1" parent="1" source="U7" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="U9" value="否">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E42" edge="1" parent="1" source="U9" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=1;exitY=0.5;entryX=0;entryY=0.5;" target="U10" value="是（插 smallbin）">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E43" edge="1" parent="1" source="U9" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=1;exitY=0.5;entryX=0;entryY=0.5;" target="U11" value="否（插 largebin）">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E44" edge="1" parent="1" source="U10" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="U12">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E45" edge="1" parent="1" source="U11" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="U12">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E46" edge="1" parent="1" source="U12" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="U13">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E47" edge="1" parent="1" source="U13" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="U14" value="是（break）">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E48" edge="1" parent="1" source="U13" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;dashed=1;strokeColor=#808080;labelBackgroundColor=#ffffff;exitX=0;exitY=0.5;entryX=0;entryY=0.5;" target="LP1" value="否（继续取下一个 chunk）">
          <mxGeometry relative="1" x="0.0505" as="geometry">
            <mxPoint as="offset" />
            <Array as="points">
              <mxPoint y="2565" />
              <mxPoint y="1745" />
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="E49" edge="1" parent="1" source="LP14" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="LP11">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E50" edge="1" parent="1" source="LP11" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=1;exitY=0.5;entryX=0;entryY=0.5;" target="LG1" value="是">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E51" edge="1" parent="1" source="LP11" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="LP12" value="否">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E52" edge="1" parent="1" source="LG1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=1;exitY=0.5;entryX=0;entryY=0.5;" target="LG2" value="是">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E53" edge="1" parent="1" source="LG1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=0.5;exitY=1;entryX=1;entryY=0.5;" target="LP12" value="否（无合适 chunk）">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E54" edge="1" parent="1" source="LG2" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="LG3">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E55" edge="1" parent="1" source="LG3" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="LG4">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E56" edge="1" parent="1" source="LG4" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="LG5">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E57" edge="1" parent="1" source="LG5" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=1;exitY=0.5;entryX=0;entryY=0.5;" target="LG6" value="是（切分返回）">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E58" edge="1" parent="1" source="LG5" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=1;exitY=0.5;entryX=0;entryY=0.5;" target="LG7" value="否（整体返回）">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E59" edge="1" parent="1" source="LP12" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="LP13">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E60" edge="1" parent="1" source="LP13" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=1;exitY=0.5;entryX=0;entryY=0.5;" target="LP16" value="是">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E61" edge="1" parent="1" source="LP13" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=1;exitY=0.5;entryX=0;entryY=0.5;" target="LP14" value="否">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E62" edge="1" parent="1" source="LP14" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="LP15">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E63" edge="1" parent="1" source="LP15" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;dashed=1;strokeColor=#808080;labelBackgroundColor=#ffffff;exitX=0;exitY=0.5;entryX=0;entryY=0.5;" target="LP13" value="否（继续查该 block 内下一个 bin）">
          <mxGeometry relative="1" x="1" y="78" as="geometry">
            <mxPoint x="-8" y="35" as="offset" />
            <Array as="points">
              <mxPoint y="2235" />
              <mxPoint y="2065" />
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="E64" edge="1" parent="1" source="LP15" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="LP23" value="是（binmap 全空 → use_top）">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E65" edge="1" parent="1" source="LP16" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="LP17">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E66" edge="1" parent="1" source="LP17" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=1;exitY=0.5;entryX=0;entryY=0.5;" target="LP18" value="是（bin 实际为空，bit 清零）">
          <mxGeometry relative="1" x="-1" y="-47" as="geometry">
            <mxPoint x="-40" y="-22" as="offset" />
          </mxGeometry>
        </mxCell>
        <mxCell id="E67" edge="1" parent="1" source="LP17" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="LP19" value="否">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E68" edge="1" parent="1" source="LP18" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;dashed=1;strokeColor=#808080;labelBackgroundColor=#ffffff;exitX=0;exitY=0.5;entryX=0;entryY=0.5;" target="LP13" value="取下一个 bin">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint y="2430" />
              <mxPoint y="2065" />
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="E69" edge="1" parent="1" source="LP19" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="LP20">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E70" edge="1" parent="1" source="LP20" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=1;exitY=0.5;entryX=0;entryY=0.5;" target="LP21" value="是（整体返回）">
          <mxGeometry relative="1" x="-1" y="-39" as="geometry">
            <mxPoint x="-30" y="-14" as="offset" />
          </mxGeometry>
        </mxCell>
        <mxCell id="E71" edge="1" parent="1" source="LP20" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="LP22" value="否（切分返回）">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E72" edge="1" parent="1" source="LP23" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="LP24">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E73" edge="1" parent="1" source="LP24" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="LP25" value="是">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E74" edge="1" parent="1" source="LP24" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="LP26" value="否">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E75" edge="1" parent="1" source="LP26" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=1;exitY=0.5;entryX=0;entryY=0.5;" target="LP27" value="是">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E76" edge="1" parent="1" source="LP26" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="LP28" value="否">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E77" edge="1" parent="1" source="LP27" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;dashed=1;strokeColor=#808080;labelBackgroundColor=#ffffff;exitX=0;exitY=0.5;entryX=0;entryY=0.5;" target="LP0" value="continue（回大循环）">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint y="3225" />
              <mxPoint y="1645" />
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="E91" edge="1" parent="1" source="LP27" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;dashed=1;strokeColor=#d79b00;labelBackgroundColor=#ffffff;exitX=1;exitY=0.5;entryX=0;entryY=0.5;" target="C0" value="调用">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E80" edge="1" parent="1" source="C0" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="C1">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E81" edge="1" parent="1" source="C1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=1;exitY=0.5;entryX=0;entryY=0.5;" target="C2" value="否（未初始化）">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E82" edge="1" parent="1" source="C1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="C3" value="是">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E83" edge="1" parent="1" source="C3" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="C4">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E84" edge="1" parent="1" source="C4" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="C5">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E85" edge="1" parent="1" source="C5" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="C6" value="是">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E86" edge="1" parent="1" source="C5" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="C16" value="否（跳到下一个 fastbin）">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E87" edge="1" parent="1" source="C16" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;dashed=1;strokeColor=#808080;labelBackgroundColor=#ffffff;exitX=1;exitY=0.5;entryX=1;entryY=0.5;" target="C5" value="是（fb++ 未到 maxfb）">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="1660" y="2795" />
              <mxPoint x="1660" y="2025" />
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="E88" edge="1" parent="1" source="C16" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="C17" value="否（全部处理完）">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E89" edge="1" parent="1" source="C6" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="C7">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E92" edge="1" parent="1" source="C7" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=1;exitY=0.5;entryX=0;entryY=0.5;" target="C8" value="是（向前合并）">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E93" edge="1" parent="1" source="C7" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="C9" value="否">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E94" edge="1" parent="1" source="C8" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="C9">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E95" edge="1" parent="1" source="C9" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=1;exitY=0.5;entryX=0;entryY=0.5;" target="C10" value="是（并入 top）">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E96" edge="1" parent="1" source="C9" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="C11" value="否">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E97" edge="1" parent="1" source="C10" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="C15">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E98" edge="1" parent="1" source="C11" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=1;exitY=0.5;entryX=0;entryY=0.5;" target="C12" value="是（向后合并）">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E99" edge="1" parent="1" source="C11" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=1;exitY=0.5;entryX=0;entryY=0.5;" target="C13" value="否（清除 inuse bit）">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E100" edge="1" parent="1" source="C12" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="C14">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E101" edge="1" parent="1" source="C13" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="C14">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E102" edge="1" parent="1" source="C14" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="C15">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E103" edge="1" parent="1" source="C15" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;dashed=1;strokeColor=#808080;labelBackgroundColor=#ffffff;exitX=1;exitY=0.5;entryX=1;entryY=0.5;" target="C6" value="是（处理下一个 chunk）">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="1660" y="2685" />
              <mxPoint x="1660" y="2130" />
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="E104" edge="1" parent="1" source="C15" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;labelBackgroundColor=#ffffff;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="C16" value="否（该链处理完）">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="E105" edge="1" parent="1" source="C2" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;dashed=1;strokeColor=#808080;labelBackgroundColor=#ffffff;exitX=1;exitY=0.5;entryX=0.5;entryY=1;" target="C17" value="返回">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="6aGmCG0RtdEc91XkMItG-3" edge="1" parent="1" source="U14" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" target="LP14" value="">
          <mxGeometry relative="1" as="geometry">
            <mxPoint x="445" y="2690" as="sourcePoint" />
            <mxPoint x="130" y="1860" as="targetPoint" />
          </mxGeometry>
        </mxCell>
        <mxCell id="LP14" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" value="遍历下一个 block&lt;br&gt;（++block）" vertex="1">
          <mxGeometry height="30" width="150" x="275" y="2245" as="geometry" />
        </mxCell>
      </root>
    </mxGraphModel>
  </diagram>
</mxfile>
