我正在阅读 golang(go1.6.2 linux/amd64) 的一些运行时代码,有人可以帮助我理解 runtime/stubs.go 文件中 getg() 函数的底层机制吗?
// getg returns the pointer to the current g.
// The compiler rewrites calls to this function into instructions
// that fetch the g directly (from TLS or from the dedicated register).
func getg() *g
Run Code Online (Sandbox Code Playgroud)
getg() 函数在这里如何操作?这个函数的主体是什么?