From 0159150a4aa0b10f9845af94726cd67ffee93b75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Tue, 12 Mar 2024 21:33:55 +0000 Subject: [PATCH] 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 --- src/cmd/go/alldocs.go | 1 + src/cmd/go/internal/test/test.go | 1 + 2 files changed, 2 insertions(+) diff --git a/src/cmd/go/alldocs.go b/src/cmd/go/alldocs.go index dde47ac1b86bb3..7800c72af3b0fd 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 f1555fd5d42b7c..ac9d2721f5e781 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