SV: SV: SV: SV: SV: SV: [elephant-devel] Memory error with Elephant

Petter Egesund Petter.Egesund at kunnskapsforlaget.no
Thu Aug 24 10:32:19 UTC 2006


Some thoughts;

I am getting a little closer, passing all 110 test except 6. Storing of
stings seems to work now. What does not work is storing of integers, and
thereby rationals, bignums, and so on.

This will not work without some larger rewriting. As far as I can see
there are two options:

1. Force serializing of integers to 32-bit, not dependent on the
underlying OS. This seems to be the easy way out. What must be rewritten
is:

- storing of fixnums (which can be larger then 32-bit on 64-bit os).
Fixnums must be stored the same way as integers are stored today.
- storing of bignums, as reading directly from the bignum using
%bignum-ref can return 32-bit or 64-bit on different platsforms. A
rewrite of storing bignums can be done on two ways, either by testing on
platform, or by doing the work ourself, by doing some bitwise operations
(something like shifting bytes doing some bitwise and, and then repeat
until 0) I would wote for the last option, as this makes the codebase
less platform-dependent (might be a small speed-penalty though (I don't
know)).

2. We can start storing integers as 64-bits on 64-bits platform.
Probably means a lot of rewring? This will probably give the fastest
benchmark-results?

I would personally go for suggestion 1, I do not think the differnce in
speed will visible at all? Any opinions?

Cheers,

Petter Egesund



More information about the elephant-devel mailing list