There exist some OpenGL functions (e.g., glDrawElements 
where a single void* param accepts either a byte offset or a pointer value. 
What is the appropriate Go param type to wrap such C params? We can't use 
unsafe.Pointer because we can't store non-pointer values (offsets) in them. 
Using uintptr might work, but my concern is that passing a Go pointer into 
C by way of a uintptr value might confuse the GC (specifically, that the 
memory would fail to be pinned if/when Go implements a moving GC).

To make this discussion more concrete, using the example of glDrawElements 
above, I want to figure out an appropriate type for T:
  func GoGlDrawElements(uint32 mode, int32 count, uint32 type, T indices) {
    C.glDrawElementsWrapper(mode, count, type, indices)


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 
For more options, visit

Reply via email to