llgo/ssa: Call to support closure

This commit is contained in:
xushiwei
2024-05-03 23:49:52 +08:00
parent f1bb42f554
commit 809a400f57
6 changed files with 106 additions and 10 deletions

View File

@@ -30,3 +30,13 @@ type Closure struct {
func NewClosure(f, data unsafe.Pointer) Closure {
return Closure{f, data}
}
// ClosureF returns the function of a closure.
func ClosureF(c Closure) unsafe.Pointer {
return c.f
}
// ClosureData returns the data of a closure.
func ClosureData(c Closure) unsafe.Pointer {
return c.data
}