We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
参考源码:源码
分别有2个程序,完成相似的功能,其中一个是纯Go函数,另外一个是Go调用C函数,对于函数调用栈有什么区别?
1、cgo程序
package main /* int sum(int a, int b) { return a+b; } */ import "C" func main() { a, b := C.int(1), C.int(2) C.sum(a, b) }
2、Go程序
package main //go:noinline func sum(a, b int) int { return a + b } func main() { a, b := 1, 2 sum(a, b) }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
cgo调用c函数时,调用栈发生了什么?
参考源码:源码
前言
分别有2个程序,完成相似的功能,其中一个是纯Go函数,另外一个是Go调用C函数,对于函数调用栈有什么区别?
1、cgo程序
2、Go程序
The text was updated successfully, but these errors were encountered: