You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GFFI return values are currently boxed to allow a .finalizeWith() method on
all return types, including primitives.
This has caused a host of small bugs because the programmer's mental model
is broken. It also complicates the ability to finish the removal of
CFunction.call. Essentially, we are constantly paying the mental/overhead
penalty of boxed types and very rarely seeing the benefit.
Suggest we move away from
var fd = _open.call("filename", O_RDWR);
fd.finalizeWith(_close, fd);
and toward something like
var fd = _open("filename", O_RDWR);
fd = gffi.finalizeWith(fd, _close, fd);
This forces a re-write of fd into a boxed type, insuring that the
programmer knows exactly what's going on -- potentially allowing code like
this:
this.fd = _open("Filename", O_RDWR);
this._fd_gcRoot = gffi.finalizeWith(null, _close, this.fd);
...and perhaps finalizeWith is now less appropriate than, say, "new
gffi.finalizingBox()".
Original issue reported on code.google.com by wes%page...@gtempaccount.com on 4 May 2010 at 3:42
The text was updated successfully, but these errors were encountered:
Original issue reported on code.google.com by
wes%page...@gtempaccount.com
on 4 May 2010 at 3:42The text was updated successfully, but these errors were encountered: