A benchmark on the trivial cgo call, to assess overhead of different

ways of calling out to cgo.
This commit is contained in:
Sebastian Zagrodzki
2017-03-01 10:51:17 +01:00
parent 2d51a51ec5
commit bed02e9838
2 changed files with 51 additions and 0 deletions

View File

@@ -381,3 +381,8 @@ func xfer_callback(cptr unsafe.Pointer) {
ch := *(*chan struct{})(cptr)
close(ch)
}
// for benchmarking
func libusbSetDebug(c *libusbContext, lvl int) {
C.libusb_set_debug((*C.libusb_context)(c), C.int(lvl))
}