Comments on: Optimizing CGO handles https://withinboredom.info/2024/08/12/optimizing-cgo-handles/ A Site About Stuff Sun, 18 Aug 2024 12:28:34 +0000 hourly 1 https://wordpress.org/?v=6.7.1 By: cavokz https://withinboredom.info/2024/08/12/optimizing-cgo-handles/#comment-286 Tue, 13 Aug 2024 10:24:05 +0000 https://withinboredom.info/?p=5356#comment-286 You may consider https://pkg.go.dev/runtime#Pinner, it allows you to pin down a Go object so that you can pass its pointer to CGO without fear of it becoming invalid.

I don’t know how expensive it is to pin down something but it should scale up quite nicely and does not require any synchronization by itself.

]]>