In lmdb-go I have been making slices from using the reflect package.


I can't remember off the top of my head where I first saw that trick. But I
  remember reading about a different project doing the same thing.

The [1<<31 - 1]byte trick is interesting though. I wonder if it is faster.
On Friday, April 1, 2016 at 6:46:09 AM UTC-7, James Bardin wrote:

On Friday, April 1, 2016 at 9:35:24 AM UTC-4, aren...@gmail.com wrote:

Thanks for your help, but this only helps with dereferencing a returned
pointer. However, the C function takes a pointer that i need to provide.
Sorry i should have pointed that out more clearly. Here is the function

CAPI(long) wkhtmltopdf_get_output(wkhtmltopdf_converter * converter,
const unsigned char **);

Give it a pointer to a nil pointer of the correct type:

var p *C.uchar
ret := wkhtmltopdf_get_output(converter, &p)
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Discussion Posts


Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 6 of 10 | next ›
Discussion Overview
groupgolang-nuts @
postedApr 1, '16 at 11:16a
activeApr 2, '16 at 9:55p



site design / logo © 2021 Grokbase