On Thursday, September 1, 2016 at 8:45:02 AM UTC-4, Luke Mauldin wrote:
>
> After I added the unsafe.Pointer conversion the code compiled:
> https://play.golang.org/p/QTPyhZzKZH
>
> So my understanding is that line 15 is jut a pointer type conversion to
> slice that is backed by the C array, so
After I added the unsafe.Pointer conversion the code compiled:
https://play.golang.org/p/QTPyhZzKZH
So my understanding is that line 15 is jut a pointer type conversion to
slice that is backed by the C array, so it doesn't matter if I choose 1 <<
20 entries or 1 << 22 entries, in both cases the
On Wed, Aug 31, 2016 at 2:06 PM, Luke Mauldin wrote:
> I modified my example based on the code example you gave at the bottom for
> the pointer arithmetic and that compiled without any go vet errors. I
> attempted to use the slice whose backing array is the C array
> https://play.golang.org/p/rJo
I modified my example based on the code example you gave at the bottom for
the pointer arithmetic and that compiled without any go vet errors. I
attempted to use the slice whose backing array is the C array
https://play.golang.org/p/rJoDMu5YAQ but I get a compile error:
main.go:14: cannot conve
On Wed, Aug 31, 2016 at 12:47 PM, Luke Mauldin wrote:
>
> I have questions about pointer arithmetic illustrated by this Play example:
> https://play.golang.org/p/-cZteTY_M2
>
> Questions:
> 1) Is this the best way to do pointer arithmetic in Go to process a C array
> and convert it to a Go slice?