// Copyright 2009 The Go Authors. All rights reserved.// Use of this source code is governed by a BSD-style// license that can be found in the LICENSE file.package runtimeimport ()//go:generate go run wincallback.go//go:generate go run mkduff.go//go:generate go run mkfastlog2table.go//go:generate go run mklockrank.go -o lockrank.govar ticks ticksTypetype ticksType struct { lock mutex val atomic.Int64}// Note: Called by runtime/pprof in addition to runtime code.func tickspersecond() int64 { := ticks.val.Load()if != 0 {return }lock(&ticks.lock) = ticks.val.Load()if == 0 { := nanotime() := cputicks()usleep(100 * 1000) := nanotime() := cputicks()if == { ++ } = ( - ) * 1000 * 1000 * 1000 / ( - )if == 0 { ++ }ticks.val.Store() }unlock(&ticks.lock)return}var envs []stringvar argslice []string//go:linkname syscall_runtime_envs syscall.runtime_envsfunc syscall_runtime_envs() []string { returnappend([]string{}, envs...) }//go:linkname syscall_Getpagesize syscall.Getpagesizefunc syscall_Getpagesize() int { returnint(physPageSize) }//go:linkname os_runtime_args os.runtime_argsfunc os_runtime_args() []string { returnappend([]string{}, argslice...) }//go:linkname syscall_Exit syscall.Exit//go:nosplitfunc syscall_Exit( int) {exit(int32())}var godebugDefault stringvar godebugUpdate atomic.Pointer[func(string, string)]var godebugEnv atomic.Pointer[string] // set by parsedebugvars//go:linkname godebug_setUpdate internal/godebug.setUpdatefunc godebug_setUpdate( func(string, string)) { := new(func(string, string)) * = godebugUpdate.Store()godebugNotify()}func godebugNotify() {if := godebugUpdate.Load(); != nil {varstringif := godebugEnv.Load(); != nil { = * } (*)(godebugDefault, ) }}//go:linkname syscall_runtimeSetenv syscall.runtimeSetenvfunc syscall_runtimeSetenv(, string) {setenv_c(, )if == "GODEBUG" { := new(string) * = godebugEnv.Store()godebugNotify() }}//go:linkname syscall_runtimeUnsetenv syscall.runtimeUnsetenvfunc syscall_runtimeUnsetenv( string) {unsetenv_c()if == "GODEBUG" {godebugEnv.Store(nil)godebugNotify() }}// writeErrStr writes a string to descriptor 2.////go:nosplitfunc writeErrStr( string) {write(2, unsafe.Pointer(unsafe.StringData()), int32(len()))}
The pages are generated with Goldsv0.6.4. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds.