[Vm-dev] FFI Plugin | Auto-conversion of char* return value into String considered harmful

Marcel Taeumel marcel.taeumel at hpi.de
Wed Jun 10 10:35:27 UTC 2020


Hi all!

The FFI plugin automatically converts "char*" return values into a Smalltalk string when returning from the FFI call.

I would rather leave this conversion to the image side because you have to do it anyway when interpreting external structures. See ExternalData >> #fromCString. And because it can be dangerous. Note that I do like automatic String-to-char* conversion when making an FFI call. Just not the other way around.

See (Threaded)FFIPlugin >> #ffiReturnCStringFrom:.

What are your thoughts on this matter?

Best,
Marcel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20200610/a5fa3458/attachment.html>


More information about the Vm-dev mailing list