Documentation ¶
Overview ¶
package sys contains system- and configuration- and architecture-specific constants used by the runtime.
Index ¶
Constants ¶
View Source
const ( ArchFamily = AMD64 BigEndian = false CacheLineSize = 64 DefaultPhysPageSize = 4096 PCQuantum = 1 Int64Align = 8 HugePageSize = 1 << 21 MinFrameSize = 0 )
View Source
const GOARCH = `amd64`
View Source
const GOOS = `linux`
View Source
const Goarch386 = 0
View Source
const GoarchAmd64 = 1
View Source
const GoarchAmd64p32 = 0
View Source
const GoarchArm = 0
View Source
const GoarchArm64 = 0
View Source
const GoarchArm64be = 0
View Source
const GoarchArmbe = 0
View Source
const GoarchMips = 0
View Source
const GoarchMips64 = 0
View Source
const GoarchMips64le = 0
View Source
const GoarchMips64p32 = 0
View Source
const GoarchMips64p32le = 0
View Source
const GoarchMipsle = 0
View Source
const GoarchPpc = 0
View Source
const GoarchPpc64 = 0
View Source
const GoarchPpc64le = 0
View Source
const GoarchS390 = 0
View Source
const GoarchS390x = 0
View Source
const GoarchSparc = 0
View Source
const GoarchSparc64 = 0
View Source
const GoosAndroid = 0
View Source
const GoosDarwin = 0
View Source
const GoosDragonfly = 0
View Source
const GoosFreebsd = 0
View Source
const GoosLinux = 1
View Source
const GoosNacl = 0
View Source
const GoosNetbsd = 0
View Source
const GoosOpenbsd = 0
View Source
const GoosPlan9 = 0
View Source
const GoosSolaris = 0
View Source
const GoosWindows = 0
View Source
const GoosZos = 0
View Source
const PtrSize = 4 << (^uintptr(0) >> 63) // unsafe.Sizeof(uintptr(0)) but an ideal const
PtrSize表示指针的size,也代表了cpu架构是32位还是64位。
View Source
const RegSize = 4 << (^Uintreg(0) >> 63) // unsafe.Sizeof(uintreg(0)) but an ideal const
Uintreg的size,不通平台不通大小,32bit为4,64bit为8
View Source
const SpAlign = 1*(1-GoarchArm64) + 16*GoarchArm64 // SP alignment: 1 normally, 16 for ARM64
Variables ¶
View Source
var DefaultGoroot string // set at link time
Functions ¶
func Bswap64 ¶
Bswap64 returns its input with byte order reversed 0x0102030405060708 -> 0x0807060504030201
Types ¶
type ArchFamilyType ¶
type ArchFamilyType int
const ( AMD64 ArchFamilyType = iota ARM ARM64 I386 MIPS MIPS64 PPC64 S390X )
Click to show internal directories.
Click to hide internal directories.