mirror of
https://github.com/fumiama/gofastTEA.git
synced 2026-06-05 07:50:26 +08:00
20 lines
531 B
Go
20 lines
531 B
Go
//go:build !go1.22
|
|
|
|
package tea
|
|
|
|
import (
|
|
_ "unsafe" // required by go:linkname
|
|
)
|
|
|
|
// randuint32 returns a lock free uint32 value.
|
|
//
|
|
// Too much legacy code has go:linkname references
|
|
// to runtime.fastrand and friends, so keep these around for now.
|
|
// Code should migrate to math/rand/v2.Uint64,
|
|
// which is just as fast, but that's only available in Go 1.22+.
|
|
// It would be reasonable to remove these in Go 1.24.
|
|
// Do not call these from package runtime.
|
|
//
|
|
//go:linkname randuint32 runtime.fastrand
|
|
func randuint32() uint32
|