For kicks, I tried running the GemStone tools in a Cog VM. It *almost* works. 
Apparently this sort of call:

> apiGciPerform: anOopType a: aString a: anArray a: anInteger
> 
>       <apicall: OopType64 'GciPerform' (OopType64 char* ulong long) >
>       ^self externalCallFailed

... works differently now. In the old (non-Cog) VM, it return an instance of 
OopType64. In Cog, it returns a SmallInteger.

The function itself returns a uint64_t, so apparently the OopType64 class (a 
subclass of ExternalStructure) is being used to trick the FFI into 
automatically wrapping the return value in the way we want.

1. Is this trick no longer supported/legit (assuming it ever was)?
2. Is there a better way to accomplish the same thing, or do we just have to do 
the wrapping ourselves now?

I'm pretty new to the FFI, so forgive me if the premise is wrong. All I know is 
that it doesn't work the way it used to. :)

--
Ken Treis
Miriam Technologies, Inc.


Reply via email to