From a88530b785e2b5a916ab0c512acbab00df7917f4 Mon Sep 17 00:00:00 2001 From: Damian Gryski Date: Fri, 15 Oct 2021 08:17:37 -0700 Subject: [PATCH] src/testing: stub B.ReportAllocs() This allows test packages that use this feature in their benchmarks to build and run (if not the benchmarks themselves). --- src/testing/benchmark.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/testing/benchmark.go b/src/testing/benchmark.go index d17b1c06a..8cce5a7a1 100644 --- a/src/testing/benchmark.go +++ b/src/testing/benchmark.go @@ -69,6 +69,12 @@ func (b *B) SetBytes(n int64) { panic("testing: unimplemented: B.SetBytes") } +// ReportAllocs enables malloc statistics for this benchmark. +func (b *B) ReportAllocs() { + // Dummy version to allow building e.g. golang.org/crypto/... + panic("testing: unimplemented: B.ReportAllocs") +} + // StartTimer starts timing a test. This function is called automatically // before a benchmark starts, but it can also be used to resume timing after // a call to StopTimer.