github.com/pidato/unsafe@v0.1.4/cgo/call.go (about) 1 //go:build !libfuzzer && !tinygo && (amd64 || arm64) && (linux || darwin) 2 3 package cgo 4 5 import "github.com/pidato/unsafe/cgo/cgo" 6 7 // NonBlocking C function fn without going all the way through cgo 8 // Be very careful using it. If the C code blocks it can/will 9 // lock up your app. 10 // Example: NonBlocking((*byte)(C.my_c_func), 0, 0) 11 // void my_c_func(size_t arg0, size_t arg1) { 12 // } 13 //go:nosplit 14 //go:noescape 15 func NonBlocking(fn *byte, arg0, arg1 uintptr) 16 17 func Blocking(fn *byte, arg0, arg1 uintptr) { 18 cgo.Blocking(fn, arg0, arg1) 19 }