Ah! It hadn't occurred to me that C.NAME would be defined in the cgo source
file. But yes, that makes sense :)

Thanks again, Ian!
On Tuesday, March 29, 2016 at 8:03:27 PM UTC-7, Ian Lance Taylor wrote:

On Tue, Mar 29, 2016 at 7:54 PM, Bryan Matsuo <bryan....@gmail.com
<javascript:>> wrote:
Thank you so much for the clarification, Ian. This has helped me greatly.
Though you never explicitly said that C can indefinitely store a pointer an
exported static Go func (even after the cgo function call which passed it
has returned). But from what you did say, it seems that is OK. Right?
Yes, I think we pretty much have to assume that an exported function
can not move.

It now occurs to me, though, that to be fully safe for a callback you
should refer to the exported name using `C.NAME`. That will pick up
the version of the function callable directly from C.

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


Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 5 of 5 | next ›
Discussion Overview
groupgolang-nuts @
postedMar 30, '16 at 1:53a
activeMar 30, '16 at 3:07a

2 users in discussion

Bryan Matsuo: 3 posts Ian Lance Taylor: 2 posts



site design / logo © 2021 Grokbase