The Future of Squeak or Squeaking at the Future?
nicolas cellier
ncellier at ifrance.com
Fri May 12 21:33:34 UTC 2006
Le Vendredi 12 Mai 2006 19:02, Andreas Raab a écrit :
> Viktor Svub wrote:
> > Isn't the number of parameters of the called function limited to some
> > fixed count?
>
> No. That's a limitation of Squeak not the FFI. The FFI can deal with
> arbitrary number of arguments but Squeak can't deal with more than 15
> right now. If you really need more you can still construct and invoke
> your FFI call manually; you just can't use the "inline" declaration.
>
> Cheers,
> - Andreas
I faced the same problem, and was not fully satisfied with workaround proposed
by andreas (build a ExternalLibraryFunction, store it in a class var, and
invoke it with an array of arguments, see
ExternalFunction>>invokeWithArguments:).
I have a working 3.9 image where i did overcome this limitation.
I can have Smalltalk methods with arbitrary number of arguments and FFI
primitives called with many arguments also.
The trick is to transparently transform the arguments into a single array
argument when Squeak bytecode limit is exceeded.
I did not published yet because decompiler and debugger facility do not work
well on such methods. Also the installation order is not trivial because
Compiler has to be changed.
However, if you're interested, let me know.
Nicolas
More information about the Squeak-dev
mailing list
|