[Haskell-cafe] Re: 64-bit Bloom filters?
uzytkownik2 at gmail.com
Tue Jan 5 14:16:27 EST 2010
On Tue, 2010-01-05 at 10:02 -0800, Bryan O'Sullivan wrote:
> Although I'm not clear on why it would cause crashes (SEGV,
> looping, etc), my prime suspect is the hashing function used.
> This is
> from C and returns a uint32, but it is imported to return a
> CInt, which
> I suspect is 64 bits.
> A CInt is 32 bits on the only 64-bit architecture that anyone really
> uses (x86_64) :-)
It does not depend on architecture but on compiler/C library:
In most popular models (LLP64/LP64) it is 32-bits. However even SILP64
with 64-byte short is correct. Compiler having 16-bit integer on x86_64
is technically correct AFAIK (althought not on POSIX).
PS. Of course it is not the problem but it should not be done. There is
nowhere written int's are 32-bits - in fact one of the reason they were
left 32-bits (except having something between short and long) was
incorrect assumption that they are.
More information about the Haskell-Cafe