You're right, I can't find where it's explicitly forbidden in the docs, but it also isn't stated that you
can pass pointers to C code either. There has been more recent discussion here (
https://code.google.com/p/go/issues/detail?id=8310) and on the mailing lists too:
> +rsc
> Passing a Go pointer like that to C is problematic because eventually
> we will want the garbage collector to be able to move things
and later on with a response from Dmitry:
>> In my opinion, the current behavior should be covered by the
>> compatibility guarantee. In Go 1, passing pointers to Go-allocated
>> memory into C was not a problem.
>
> This was never fully working. Only some individual cases were working.
Even though your C thread is being run synchronously, the GC is running concurrently in another thread (concurrent GC was introduced in go1.3), and has the ability to alter the memory that was passed to your C function.