Skip to content

Commit 92bab0f

Browse files
docs:补充说明内存逃逸分析命令
- 添加了用于查看内存逃逸分析的 Go命令示例 -说明了如何通过编译选项查看内存从栈逃逸到堆的情况 - 提供了两种详细程度的分析命令
1 parent f21b273 commit 92bab0f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

go/go.adoc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,7 @@ func main() {
510510
fmt.Println("x 的值:", x)
511511
}
512512
----
513+
513514
输出如下
514515

515516
x 的值:1000
@@ -1273,4 +1274,13 @@ $ gdb -tui demo
12731274
$ gdb demo
12741275
----
12751276

1277+
如果使用gdb有一些报错需要在gdbinit中添加如下配置来去除安全保护措施
1278+
1279+
[source, bash]
1280+
----
1281+
line to your configuration file "/home/andrew/.config/gdb/gdbinit".
1282+
To completely disable this security protection add
1283+
set auto-load safe-path /
1284+
----
1285+
12761286

0 commit comments

Comments
 (0)