[squeak-dev] Re: FFI related questions

Andreas Raab andreas.raab at gmx.de
Tue Jan 5 20:13:28 UTC 2010


vagy wrote:
> Thanx for the tip. I saw your code, though i was thinking more
> along the lines of having a standard DoubleArray implementation in the 
> image
> as we have for 32bit Floats. I just saw that FloatArray is implemented in
> terms of variableWordSubclass but there is no variableDoubleWordSubclass
> which, at first glance, may make the whole issue of having a standard
> DoubleArray non trivial. I think we need the opinion of a VM expert here.
> In any way, what do you think about having a standard DoubleArray?

You're right it's nontrivial, at least for the current object model. 
Many platforms have 8 byte alignment requirements for doubles and our 
oops are only 4 byte aligned. This is the main reason why there isn't a 
double array - since garbage collector will move objects around there is 
absolutely no guarantee that the double array will be 8 byte aligned. 
And having a double array that the code in the VM needs to shift to 
align properly would completely defeat the purpose of having it in the 
first place. This may change with the move to 64 bit or perhaps with 
some of Eliot's ideas about changing the object format, but it's nothing 
that is going to happen in the short term.

Cheers,
   - Andreas




More information about the Squeak-dev mailing list