vendor: Mega update all dependencies
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4080
This commit is contained in:
53
vendor/github.com/petermattis/goid/goid_go1.6plus.go
generated
vendored
Normal file
53
vendor/github.com/petermattis/goid/goid_go1.6plus.go
generated
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
// +build amd64 amd64p32 arm
|
||||
// +build go1.6
|
||||
|
||||
package goid
|
||||
|
||||
import "unsafe"
|
||||
|
||||
// Just enough of the structs from runtime/runtime2.go to get the offset to goid.
|
||||
// See https://github.com/golang/go/blob/release-branch.go1.6/src/runtime/runtime2.go
|
||||
|
||||
type stack struct {
|
||||
lo uintptr
|
||||
hi uintptr
|
||||
}
|
||||
|
||||
type gobuf struct {
|
||||
sp uintptr
|
||||
pc uintptr
|
||||
g uintptr
|
||||
ctxt uintptr
|
||||
ret uintptr
|
||||
lr uintptr
|
||||
bp uintptr
|
||||
}
|
||||
|
||||
type g struct {
|
||||
stack stack
|
||||
stackguard0 uintptr
|
||||
stackguard1 uintptr
|
||||
|
||||
_panic uintptr
|
||||
_defer uintptr
|
||||
m uintptr
|
||||
stackAlloc uintptr
|
||||
sched gobuf
|
||||
syscallsp uintptr
|
||||
syscallpc uintptr
|
||||
stkbar []uintptr
|
||||
stkbarPos uintptr
|
||||
stktopsp uintptr
|
||||
param unsafe.Pointer
|
||||
atomicstatus uint32
|
||||
stackLock uint32
|
||||
goid int64 // Here it is!
|
||||
}
|
||||
|
||||
// Backdoor access to runtime·getg().
|
||||
func getg() uintptr // in goid_go1.5plus{,_arm}.s
|
||||
|
||||
func Get() int64 {
|
||||
gg := (*g)(unsafe.Pointer(getg()))
|
||||
return gg.goid
|
||||
}
|
||||
Reference in New Issue
Block a user