[squeak-dev] Passing string to FFI function expecting array of strings (char**)

Michał Olszewski m.olszewski at nexat.pl
Sat Apr 2 01:34:20 UTC 2022


As in the title, what's the way to pass single string to External 
Function that expects array of strings (char**)? I know that the way to 
do that in plain C would be something like this: &myString but I have 
not idea how to manipulate Squeak objects such that I can pass their 
addresses manually to FFI. I guess I have to somehow wrap stuff into 
ExternalData but how?

The image used is: Squeak 6.0 alpha 21520.

I assume the new FFI interface will be released along with Squeak 6.0? :)

At last, quick question: are objects passed to FFI (the ones allocated 
on the Squeak heap) auto-pinned or do I need pin them manually?


More information about the Squeak-dev mailing list