3 ms·
It'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/#Ke
by yencabulator 7y ago
It'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.