github.com/grailbio/base@v0.0.11/gtl/tests/randomized_freepool_internal.go (about) 1 // Code generated by generate_randomized_freepool.py. DO NOT EDIT. 2 package tests 3 4 // This import is needed to use go:linkname. 5 import _ "unsafe" 6 7 // The following functions are defined in go runtime. To use them, we need to 8 // import "unsafe", and elsewhere in this package, import "C" to force compiler 9 // to recognize the "go:linktime" directive. Some of the details are explained 10 // in the below blog post. 11 // 12 // procPin() pins the caller to the current processor, and returns the processor 13 // id in range [0,GOMAXPROCS). procUnpin() undos the effect of procPin(). 14 // 15 // http://www.alangpierce.com/blog/2016/03/17/adventures-in-go-accessing-unexported-functions/ 16 17 //go:linkname runtime_procPin sync.runtime_procPin 18 //go:nosplit 19 func runtime_procPin() int 20 21 //go:linkname runtime_procUnpin sync.runtime_procUnpin 22 //go:nosplit 23 func runtime_procUnpin() 24 25 //go:linkname fastrandn sync.fastrandn 26 func fastrandn(n uint32) uint32