Thanks for the clarification. I suppose internal UnlockOSThread does not 
override the runtime.LockOSThread by my code from the outside?

Not really.  On error you could malloc a buffer, copy in the string, 
> and return the buffer to Go.  In Go you could copy the buffer into Go 
> memory and C.free the buffer.  That approach isn't any better than 
> what you are doing today, but it would work (it does copy the buffer 
> twice, but presumably errors are not the common case). 
>

That's a good suggestion. I suspect that in a typical usage an error will 
lead to program termination, connection termination or user interaction via 
some user interface, so the performance of the two allocations and the two 
copies will not be an issue.

-- 
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.

Reply via email to