Repository navigation
fix: 修正 Linux/macOS 中字符串风格字段的读取顺序 - #1
Merged
Merged
Conversation
H3CoF6
added a commit
that referenced
this pull request
Oct 5, 2026
#1 提交把非 Windows 平台一刀切改成 macOS ARM 的读法,等于对调了 Linux/Intel-mac 与 Apple-Silicon 的行为:mac ARM 修好了,Linux 反而读 不出 a2/d2/d2key。 实测两平台的 SessionForNt 字段布局,长度都在 +8,只有指针位置不同: A 型(Linux x64 / Intel macOS):+0 容量、+8 长度、+0x10 指针 B 型(Apple Silicon) :+0 指针、+8 长度、+0x10 容量/标志 改为不按平台猜,而是两个候选指针都试、按内容打分挑出更像 key 的 (全 hex ASCII 优先),单个平台 ABI 再变也不会整片崩。实例选择同步 改为打分制(d2key 有效 +2、a2/d2 可读各 +1),取字段最全的候选。 为可测性抽出 FieldMem 接口与 score_key_bytes,新增 7 组单测,其中 两组以 Linux 实测值与你提供的 mac ARM heapdump 快照为回归基准;已反向 验证:把逻辑改回任一方向的'按平台猜',对应测试即失败。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
修正 Linux/macOS 中字符串风格字段的读取顺序
Linux/macOS:
+0为数据指针、+8为长度、+0x10为容量/标志