async: work both go and llgo
This commit is contained in:
12
x/cbind/buf.go
Normal file
12
x/cbind/buf.go
Normal file
@@ -0,0 +1,12 @@
|
||||
package cbind
|
||||
|
||||
import "unsafe"
|
||||
|
||||
type slice struct {
|
||||
data unsafe.Pointer
|
||||
len int
|
||||
}
|
||||
|
||||
func GoBytes(buf *int8, n int) []byte {
|
||||
return *(*[]byte)(unsafe.Pointer(&slice{unsafe.Pointer(buf), n}))
|
||||
}
|
||||
Reference in New Issue
Block a user