github.com/moontrade/mdbx-go@v0.4.0/internal/unsafecgo/call.go (about)

     1  //go:build !libfuzzer && !tinygo && (amd64 || arm64) && (linux || darwin)
     2  
     3  package unsafecgo
     4  
     5  import "github.com/moontrade/mdbx-go/internal/unsafecgo/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  }