ByteArray and FFI?

Avi Bryant avi at beta4.com
Tue Feb 4 23:06:14 UTC 2003


On Tue, 4 Feb 2003, Markus Fritsche wrote:

> (ByteArray new: 50)
>         integerAt: 1
>         put: 7
>         size: 4
>         signed: false

> Because on my fresh gentoo linux, I did not have libffi installed. That leads
> me to my question: why is ffi used for the above code? I thougt 'ffi' stands
> for 'foreign function interface', and is slow and should be avoided. Why does
> something 'simple' like a ByteArray need ffi?

Markus,

That got me at first too.  You need to look in the 'platform independent'
protocol instead of the 'external access' protocol.  For example, use

 (ByteArray new: 50)
    unsignedLongAt: 1
    put: 7
    bigEndian: false

Cheers,
Avi



More information about the Squeak-dev mailing list