diff options
Diffstat (limited to 'src/runtime/runtime2.go')
| -rw-r--r-- | src/runtime/runtime2.go | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/src/runtime/runtime2.go b/src/runtime/runtime2.go index 01f1a50670..e64be992b0 100644 --- a/src/runtime/runtime2.go +++ b/src/runtime/runtime2.go @@ -6,6 +6,7 @@ package runtime import ( "internal/abi" + "internal/chacha8rand" "internal/goarch" "runtime/internal/atomic" "runtime/internal/sys" @@ -577,7 +578,6 @@ type m struct { isExtraInC bool // m is an extra m that is not executing Go code isExtraInSig bool // m is an extra m in a signal handler freeWait atomic.Uint32 // Whether it is safe to free g0 and delete m (one of freeMRef, freeMStack, freeMWait) - fastrand uint64 needextram bool traceback uint8 ncgocall uint64 // number of cgo calls in total @@ -632,6 +632,9 @@ type m struct { mOS + chacha8 chacha8rand.State + cheaprand uint64 + // Up to 10 locks held by this m, maintained by the lock ranking code. locksHeldLen int locksHeld [10]heldLockInfo @@ -1009,27 +1012,6 @@ type forcegcstate struct { idle atomic.Bool } -// extendRandom extends the random numbers in r[:n] to the whole slice r. -// Treats n<0 as n==0. -func extendRandom(r []byte, n int) { - if n < 0 { - n = 0 - } - for n < len(r) { - // Extend random bits using hash function & time seed - w := n - if w > 16 { - w = 16 - } - h := memhash(unsafe.Pointer(&r[n-w]), uintptr(nanotime()), uintptr(w)) - for i := 0; i < goarch.PtrSize && n < len(r); i++ { - r[n] = byte(h) - n++ - h >>= 8 - } - } -} - // A _defer holds an entry on the list of deferred calls. // If you add a field here, add code to clear it in deferProcStack. // This struct must match the code in cmd/compile/internal/ssagen/ssa.go:deferstruct |
