From: Kévin Dunglas Date: Tue, 12 Mar 2024 21:33:55 +0000 (+0000) Subject: cmd/go: update docs for go test -benchmem X-Git-Tag: go1.23rc1~887 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=0159150a4aa0b10f9845af94726cd67ffee93b75;p=gostls13.git cmd/go: update docs for go test -benchmem Mention that the allocation counter doesn't count allocations made using C.malloc (cgo) or in C. Change-Id: I03c23b6d8cfde68c04a75732a0d3c05eedae2276 GitHub-Last-Rev: 2d805b3322327b73076a197628987ac874311664 GitHub-Pull-Request: golang/go#65430 Reviewed-on: https://go-review.googlesource.com/c/go/+/560397 Auto-Submit: Bryan Mills Reviewed-by: Cherry Mui Reviewed-by: qiulaidongfeng <2645477756@qq.com> LUCI-TryBot-Result: Go LUCI Reviewed-by: Bryan Mills --- diff --git a/src/cmd/go/alldocs.go b/src/cmd/go/alldocs.go index dde47ac1b8..7800c72af3 100644 --- a/src/cmd/go/alldocs.go +++ b/src/cmd/go/alldocs.go @@ -3116,6 +3116,7 @@ // // -benchmem // Print memory allocation statistics for benchmarks. +// Allocations made in C or using C.malloc are not counted. // // -blockprofile block.out // Write a goroutine blocking profile to the specified file diff --git a/src/cmd/go/internal/test/test.go b/src/cmd/go/internal/test/test.go index f1555fd5d4..ac9d2721f5 100644 --- a/src/cmd/go/internal/test/test.go +++ b/src/cmd/go/internal/test/test.go @@ -353,6 +353,7 @@ profile the tests during execution: -benchmem Print memory allocation statistics for benchmarks. + Allocations made in C or using C.malloc are not counted. -blockprofile block.out Write a goroutine blocking profile to the specified file