4 ms·
A problem with Go's FFI is that the Go folks haven't decided yet whether objects can move in memory. If that is the case, then storing a pointer to a Go object
by amelius 12y ago
A problem with Go's FFI is that the Go folks haven't decided yet whether objects can move in memory. If that is the case, then storing a pointer to a Go object is a no-go, since the object the pointer points to may have moved when the pointer is dereferenced in a foreign function. See [1] for some discussion.
[1] https://code.google.com/p/go/issues/detail?id=8310 https://code.google.com/p/go/issues/detail?id=8310
- deleted 12y ago[deleted]
- enneff 12y agoWe have decided. Don't store pointers to Go objects. https://github.com/golang/go/issues/8310 https://github.com/golang/go/issues/8310
- amelius 12y agoI only see "Disabling comments until we post our new proposal. We are still working on the wording." I really hope the concerns that were raised on this issue-page are not simply ignored, and I hope that this new proposal allows for an efficient FFI interface.
- enneff 12y agoNo, they are not ignored. Comments were disabled because we are well aware of the problem space, so further discussion was not adding anything. The garbage collector has been rewritten for 1.5 and work continues on that front. Once the tree has stabilised (we're in the stabilisation period of our release cycle now) we will have a better idea how to resolve this issue.