Version: v0.0.0-...-8a52383 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Jan 31, 2019 License: BSD-3-Clause Imports: 0 Imported by: 0



Package cpu implements processor feature detection used by the Go standard library.



View Source
const CacheLinePadSize = 64
View Source
const GOARCH = "amd64"


View Source
var ARM arm
View Source
var ARM64 arm64
View Source
var CacheLineSize uintptr = CacheLinePadSize

CacheLineSize is the CPU's assumed cache line size. There is currently no runtime detection of the real cache line size so we use the constant per GOARCH CacheLinePadSize as an approximation.

View Source
var DebugOptions bool

DebugOptions is set to true by the runtime if the OS supports reading GODEBUG early in runtime startup. This should not be changed after it is initialized.

View Source
var PPC64 ppc64
View Source
var S390X s390x
View Source
var X86 x86


func Initialize

func Initialize(env string)

Initialize examines the processor and sets the relevant variables above. This is called by the runtime package early in program initialization, before normal init functions are run. env is set by runtime if the OS supports cpu feature options in GODEBUG.


type CacheLinePad

type CacheLinePad struct {
	// contains filtered or unexported fields

CacheLinePad is used to pad structs to avoid false sharing.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL