[squeak-dev] Passing RawBitsArray subtypes to FFI?

Marcel Taeumel marcel.taeumel at hpi.de
Tue Sep 7 09:30:51 UTC 2021


Hi, there.

> However, I'm unable to do this because the call results in "could not
> coerce the arguments" error.

https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/569 [https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/569]


We are on it. Sorry for the inconvenience.

Best,
Marcel
Am 07.09.2021 08:58:36 schrieb Michał Olszewski <m.olszewski at nexat.pl>:
Hello,

I'm currently working on bindings to vector graphics engine library and,
to avoid creating redundant classes, I pass float arrays (Float64Array)
to functions expecting a struct (the parameter is declared as
void*/double*. Its not like C cares whether its an array of constant
size or a struct).

However, I'm unable to do this because the call results in "could not
coerce the arguments" error.

I performed a small test, by using #adoptInstance (damn, love how I can
fiddle with guts of the system, so cool) on Float64Array object to turn
it into ByteArray and... it actually works.

Am I doing something wrong or it's just that the FFI doesn't support
passing RawBitsArray subclasses (besides ByteArray) yet?

PS. I'm using Squeak 6.0 20623



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20210907/0a078b68/attachment.html>


More information about the Squeak-dev mailing list