4 ms·
Intentionally so: that's the only way to cooperate with C and memory-mapped kernel and hardware ABIs. There is an explicit mechanism to pin memory. https://pkg
by yencabulator 3y ago
Intentionally so: that's the only way to cooperate with C and memory-mapped kernel and hardware ABIs. There is an explicit mechanism to pin memory.
https://pkg.go.dev/cmd/cgo#hdr-Passing_pointers https://pkg.go.dev/cmd/cgo#hdr-Passing_pointers
https://pkg.go.dev/runtime#Pinner https://pkg.go.dev/runtime#Pinner
I think it's also worth pointing out that the main Go implementation has a non-moving GC (at this time), and all kinds of fecal matter may impact a rotary ventilation device if and when that changes. Like, are we supposed to pin byte arrays we pass to syscalls? Nobody does that, right now, for short-living calls.