mirror of
https://github.com/hanzoai/visor.git
synced 2026-09-24 17:04:14 +00:00
When calling cgo.Read, cgo.Write, and cgo.Sendto with a single-block BlockSeq, the backing slice address was converted to uintptr via Addr(). Because Go's garbage collector does not recognize uintptr as a live pointer reference, the underlying backing array could be collected or reused during the CGO call. This adds runtime.KeepAlive on the BlockSeq arguments after each single-block CGO call in ReadToBlocks and WriteFromBlocks. PiperOrigin-RevId: 968029244