It may be considerably more efficient to pass the Go pointers directly. To do so, you may need to convert through unsafe.Pointer.
Note that many C APIs that take a char* expect it to be null-terminated, so if you take that approach you may need to append an extra 0 to the slice. https://golang.org/cl/56530 has some examples. On Tuesday, January 23, 2018 at 11:31:44 AM UTC-5, Jan Mercl wrote: > > On Tue, Jan 23, 2018 at 5:02 PM Christian LeMoussel <cnh...@gmail.com > <javascript:>> wrote: > > > Is it correct /best way ? > > Hopefully/only. But as noted previously, not tested. > > > There is no memory leaks ? > > Something must eventually C.free() the memory allocated by C.CString(). > > > > -- > > -j > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.