From aee771224c9c72829815bb59b7d785147ac3ced2 Mon Sep 17 00:00:00 2001 From: "lqw@128C" Date: Tue, 21 Apr 2026 10:02:34 +0800 Subject: [PATCH] docs(principle): fix gcmask typo fix gcmask typo in "DWARF Type Scanning" section Closes #66 --- docs/principle.md | 4 ++-- docs/principle_cn.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/principle.md b/docs/principle.md index fe864ae..f541d72 100644 --- a/docs/principle.md +++ b/docs/principle.md @@ -122,7 +122,7 @@ To implement this hybrid approach, whenever we access an object's pointer using

-For example, when accessing the `Object` mentioned above, its gcmask is `1010`. After reading field A, the gcmask becomes `1000`. If field C isn't accessed due to type coercion, it will be accounted for during the final GC marking scan. +For example, when accessing the `Object` mentioned above, its gcmask is `1001`. After reading field A, the gcmask becomes `1000`. If field C isn't accessed due to type coercion, it will be accounted for during the final GC marking scan. Beyond type coercion, out-of-bounds memory references are another common issue. For instance, in the earlier example code `var b *int64 = &echo().B`, both fields A and C belong to memory that cannot be scanned through DWARF types and will also be accounted for during the final scan. @@ -164,4 +164,4 @@ Once all objects are scanned, the reference chains along with object counts and - `runtime.SetFinalizer.obj` (the target object) - `runtime.SetFinalizer.fn` (the finalizer function) -- **Sub-objects without DWARF type info**: `$sub_objects$` \ No newline at end of file +- **Sub-objects without DWARF type info**: `$sub_objects$` diff --git a/docs/principle_cn.md b/docs/principle_cn.md index dedcf36..c6e192a 100644 --- a/docs/principle_cn.md +++ b/docs/principle_cn.md @@ -124,7 +124,7 @@ func echo() *byte {

-例如,上述 `Object` 对象访问时,其 gcmask 是`1010`,读取字段 A 后,gcmask 变成 `1000`,如果字段 C 因为类型强转没有访问到,则在最终扫描的 GC 标记时就会被统计到。 +例如,上述 `Object` 对象访问时,其 gcmask 是`1001`,读取字段 A 后,gcmask 变成 `1000`,如果字段 C 因为类型强转没有访问到,则在最终扫描的 GC 标记时就会被统计到。 除了类型强转外,引用内存越界问题也很常见,如上文示例代码`var b *int64 = &echo().B`所示,字段 A 和 C 都属于无法被 DWARF 类型扫描的内存,也会在最终扫描时被统计。