-
Notifications
You must be signed in to change notification settings - Fork 92
Go 1.6 is more strict: cgo argument has Go pointer to Go pointer #31
Comments
Actually, this output is from running the tests of v8dispatcher (that uses v8worker). I will try a build of v8worker now. |
Some discussions around this topic https://groups.google.com/forum/#!searchin/golang-nuts/cgo$20argument$20has$20Go$20pointer$20to$20Go$20pointer/golang-nuts/gnH0nhPf36I/4Shly3gxEwAJ which refers to golang/go#12416 |
As described in the previous discussions (see links), a workaround is to use |
I guess this is caused by storing a pointer to the Go worker object in the data field of the C worker object. Line 70 in a2fb65d
We don't need to do this - the data object is opaque to the C code. We could use some sort of look up table in the golang side to store all the workers and just send a key (an integer?) to the C code. I'll try to do this now.. writing this out in case I get distracted and don't finish. |
I was thinking about putting the callbacks in some registry to avoid having pointer values inside the worker struct (the map-registry approach as mentioned in the issue). |
Signed-off-by: Vladimir Cernov <[email protected]>
Today, at FOSDEM in Brussel, I learned about a new compiler change regarding the use of pointers in cgo. Wondering if this would affect v8worker, I tried building the project using 1.6rc1. I hope we can find a way to play by the new rules.
The text was updated successfully, but these errors were encountered: