[fix] Problem with ByteArray and FFI??

Chris Muller afunkyobject at yahoo.com
Mon Apr 28 18:09:22 UTC 2003


Michael van der Gulik wrote:

> Luckily, the problem is easy to fix: ByteArray>>maUint:at and 
> maUint:at:put both have handy (big-endian?) alternative implementations 
> at the end of the function. Commenting out the first part of these 
> methods works quite nicely.. I think. Untested, but it doesn't crash and 
> burn this time.

Yes, these "alternative implementations" work exactly the same as their FFI
counterparts, except for speed.  You should be able to leave the code commented
out, however, since Magma spends a LOT of time in these two methods, so it may
make it run slower, but it should still work.

Also, I believe it uses little-endian format, not big.

> A question remains: something like ByteArray>>integerAt:.... seems like 
> fairly basic functionality. Why aren't these just "normal" primitives, 
> or at least compiled into core Squeak instead of in the FFI (which I 
> assume to be the Foreign Function Interface). FFI is platform dependant.

I'd love to see this be made non-platform dependent, and also for it to be
pluggable with arbitrary bit-sizes, as maUint:at:, and maUint:at:put: are.  If
this were done, Magma would probably run quite faster.  :-)

Regards,
  Chris


__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com



More information about the Squeak-dev mailing list