]> Cypherpunks repositories - gostls13.git/commitdiff
testing: fix bloop doc
authorJunyang Shao <shaojunyang@google.com>
Wed, 26 Nov 2025 19:15:51 +0000 (19:15 +0000)
committerJunyang Shao <shaojunyang@google.com>
Wed, 26 Nov 2025 20:22:05 +0000 (12:22 -0800)
This CL deletes the compiler detail part from bloop documentation.

Change-Id: I73933707a593d4958e2300416d15e7213f001c3a
Reviewed-on: https://go-review.googlesource.com/c/go/+/724800
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
src/testing/benchmark.go

index fbd82beb8474b4f55a4563f1da603547dea2b542..9352e7380953f80d8429ec54bf40b3cbdaf8bceb 100644 (file)
@@ -483,14 +483,12 @@ func (b *B) loopSlowPath() bool {
 // the timer so cleanup code is not measured.
 //
 // Within the body of a "for b.Loop() { ... }" loop, arguments to and
-// results from function calls and assignment receivers within the loop are kept
+// results from function calls and assigned variables within the loop are kept
 // alive, preventing the compiler from fully optimizing away the loop body.
 // Currently, this is implemented as a compiler transformation that wraps such
-// variables with a runtime.KeepAlive intrinsic call. The compiler can recursively
-// walk the body of for, if statments, the cases of switch, select statments
-// and bracket-braced blocks. This applies only to statements syntactically between
-// the curly braces of the loop, and the loop condition must be written exactly
-// as "b.Loop()".
+// variables with a runtime.KeepAlive intrinsic call. This applies only to
+// statements syntactically between the curly braces of the loop, and the loop
+// condition must be written exactly as "b.Loop()".
 //
 // After Loop returns false, b.N contains the total number of iterations that
 // ran, so the benchmark may use b.N to compute other average metrics.