[squeak-dev] FFI | How to declare pointer to external structure in #fields?

Levente Uzonyi leves at caesar.elte.hu
Mon May 18 19:33:06 UTC 2020


How does UFFI come here? AFAIK it's nothing but a different image-side 
code using the VM's FFI implementation along with the signature notion 
Igor used in NativeBoost (which is great btw because it's "as you would 
write it in C" and doesn't require language changes).


Levente

On Mon, 18 May 2020, Jakob Reschke wrote:

> Do we even have UFFI in Squeak? This was the thing I meant is missing to reuse Pharo's libgit2 bindings, in the vm-dev thread. 
> 
> Marcel Taeumel <marcel.taeumel at hpi.de> schrieb am Mo., 18. Mai 2020, 20:07:
>       Hi Vanessa,
> > I don't have the code in front of me but there is the parser you could check ;)
> 
> I tried. I suspect that the generator cannot do it but I have to wrap it manually. But I am not sure. Reverse engineering UnifiedFFI did not help yet either. Have to put more time into it. :-)
> 
> Best,
> Marcel
>
>       Am 18.05.2020 20:00:16 schrieb Vanessa Freudenberg <vanessa at codefrau.net>:
>
>       On Mon, May 18, 2020 at 7:05 AM Marcel Taeumel <marcel.taeumel at hpi.de> wrote:
>       Hi, there!
> 
> In the #fields method of a new ExternalStructure, how can I express a pointer to another external structure?
> 
> First, non-pointer works as expected:
> ^ #( (other MyStruct) )
> 
> Second, this just treats it as a void*, which returns a generic ExternalData:
> ^ #( (other 'MyStruct*') )
> 
> Third, this gives me a debugger:
> ^ #( (other MyStruct *) )
> 
> 
> I don't have the code in front of me but there is the parser you could check ;)
> 
> It might be *MyStruct.
> 
>  - Vanessa - 
> 
> 
> 
>


More information about the Squeak-dev mailing list