]> Cypherpunks repositories - gostls13.git/commit
cmd/cgo: add C.CBytes
authorJames Bardin <j.bardin@gmail.com>
Wed, 16 Mar 2016 17:53:53 +0000 (13:53 -0400)
committerIan Lance Taylor <iant@golang.org>
Wed, 16 Mar 2016 23:22:10 +0000 (23:22 +0000)
commit5a34472d74637c84752d2c13ace78e4e6ab756b7
tree293131d3c10cfec05a33d75b4ef2a767a4f5a885
parent3e54ca9a4624fda0bcd76192aa529e826ef12b4f
cmd/cgo: add C.CBytes

Add a C.CBytes function to copy a Go byte slice into C memory. This
returns an unsafe.Pointer, since that is what needs to be passed to
C.free, and the data is often opaque bytes anyway.

Fixes #14838

Change-Id: Ic7bc29637eb6f1f5ee409b3898c702a59833a85a
Reviewed-on: https://go-review.googlesource.com/20762
Reviewed-by: Ian Lance Taylor <iant@golang.org>
misc/cgo/test/cgo_test.go
misc/cgo/test/issue14838.go [new file with mode: 0644]
src/cmd/cgo/doc.go
src/cmd/cgo/out.go