3 ms·
Which is a problem here, because the OP is calling Rust from Go using the Go calling sequence. So Go's checking doesn't know it's calling non-Go code. There's a
by Animats 7y ago
Which is a problem here, because the OP is calling Rust from Go using the Go calling sequence. So Go's checking doesn't know it's calling non-Go code. There's a defined way to call C from Go, but the OP is not using that interface.
- yencabulator 7y agoIt's fine as long as you don't store Go pointers in non-Go memory. If the local variable is the last reference to the thing, https://golang.org/pkg/runtime/#KeepAlive https://golang.org/pkg/runtime/#KeepAlive makes sure the Go side doesn't drop it before the call is complete.