I ran go fmt to fix format on the entire repository.
Change-Id: I2f09166b6b8ba0ffb0ba27f6500efb0ea4cf21ff
Reviewed-on: https://go-review.googlesource.com/c/go/+/566835
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
)
var (
- GOROOT = os.Getenv("GOROOT") // cached for efficiency
- GOARCH = envOr("GOARCH", defaultGOARCH)
- GOOS = envOr("GOOS", defaultGOOS)
- GO386 = envOr("GO386", defaultGO386)
- GOAMD64 = goamd64()
- GOARM = goarm()
- GOMIPS = gomips()
- GOMIPS64 = gomips64()
- GOPPC64 = goppc64()
+ GOROOT = os.Getenv("GOROOT") // cached for efficiency
+ GOARCH = envOr("GOARCH", defaultGOARCH)
+ GOOS = envOr("GOOS", defaultGOOS)
+ GO386 = envOr("GO386", defaultGO386)
+ GOAMD64 = goamd64()
+ GOARM = goarm()
+ GOMIPS = gomips()
+ GOMIPS64 = gomips64()
+ GOPPC64 = goppc64()
GORISCV64 = goriscv64()
- GOWASM = gowasm()
- ToolTags = toolTags()
- GO_LDSO = defaultGO_LDSO
- Version = version
+ GOWASM = gowasm()
+ ToolTags = toolTags()
+ GO_LDSO = defaultGO_LDSO
+ Version = version
)
// Error is one of the errors found (if any) in the build configuration.
//
// Next is //go:nosplit to allow its use in the runtime
// with per-m data without holding the per-m lock.
+//
//go:nosplit
func (s *State) Next() (uint64, bool) {
i := s.i
}
// clone is implemented in the runtime package.
+//
//go:linkname clone maps.clone
func clone(m any) any
)
// provided by runtime
+//
//go:linkname runtime_rand runtime.rand
func runtime_rand() uint64
// markDoneSema protects transitions from mark to mark termination.
markDoneSema uint32
- bgMarkDone uint32 // cas to 1 when at a background mark completion point
+ bgMarkDone uint32 // cas to 1 when at a background mark completion point
// Background mark completion signaling
// mode is the concurrency mode of the current GC cycle.
}
// rand32 is uint32(rand()), called from compiler-generated code.
+//
//go:nosplit
func rand32() uint32 {
return uint32(rand())
// rand returns a random uint64 from the per-m chacha8 state.
// Do not change signature: used via linkname from other packages.
+//
//go:nosplit
//go:linkname rand
func rand() uint64 {
// randn is like rand() % n but faster.
// Do not change signature: used via linkname from other packages.
+//
//go:nosplit
//go:linkname randn
func randn(n uint32) uint32 {
// cheaprand must not be exported to other packages:
// the rule is that other packages using runtime-provided
// randomness must always use rand.
+//
//go:nosplit
func cheaprand() uint32 {
mp := getg().m
// cheaprand64 must not be exported to other packages:
// the rule is that other packages using runtime-provided
// randomness must always use rand.
+//
//go:nosplit
func cheaprand64() int64 {
return int64(cheaprand())<<31 ^ int64(cheaprand())
// cheaprandn must not be exported to other packages:
// the rule is that other packages using runtime-provided
// randomness must always use randn.
+//
//go:nosplit
func cheaprandn(n uint32) uint32 {
// See https://lemire.me/blog/2016/06/27/a-fast-alternative-to-the-modulo-reduction/
readerCount atomic.Int32 // number of pending readers
readerWait atomic.Int32 // number of departing readers
- readRank lockRank // semantic lock rank for read locking
+ readRank lockRank // semantic lock rank for read locking
}
// Lock ranking an rwmutex has two aspects:
// acquire of readRank for the duration of a read lock.
//
// The lock ranking must document this ordering:
-// - readRankInternal is a leaf lock.
-// - readRank is taken before readRankInternal.
-// - writeRank is taken before readRankInternal.
-// - readRank is placed in the lock order wherever a read lock of this rwmutex
-// belongs.
-// - writeRank is placed in the lock order wherever a write lock of this
-// rwmutex belongs.
+// - readRankInternal is a leaf lock.
+// - readRank is taken before readRankInternal.
+// - writeRank is taken before readRankInternal.
+// - readRank is placed in the lock order wherever a read lock of this rwmutex
+// belongs.
+// - writeRank is placed in the lock order wherever a write lock of this
+// rwmutex belongs.
func (rw *rwmutex) init(readRank, readRankInternal, writeRank lockRank) {
rw.readRank = readRank
}
// from runtime
+//
//go:linkname runtime_randn runtime.randn
func runtime_randn(n uint32) uint32