github.com/moontrade/wavm-go@v0.3.2-0.20220316110326-d229dd66ad65/unsafecgo/call.go (about)

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