package cpu

import "internal/cpu"

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

Index

Constants

const CacheLinePadSize = 64
const GOARCH = "amd64"

Variables

var ARM arm
var ARM64 arm64
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.

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.

var PPC64 ppc64
var S390X s390x
var X86 x86

Functions

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.

Types

type CacheLinePad

type CacheLinePad struct {
	// contains filtered or unexported fields
}

CacheLinePad is used to pad structs to avoid false sharing.

Source Files

cpu.go cpu_amd64.go cpu_x86.go

Version
v1.14.13
Published
Dec 3, 2020
Platform
darwin/amd64
Last checked
2 minutes ago

Tools for package owners.