On Tue, 2012-01-03 at 18:00 -0500, Simo Sorce wrote:
>From [PATCH 0/0] A shared memory cache to perform better:
0/3: New utility functions/headers
These are also quite straightforward but they are useless without the
later patches
Nack.
Your implementation doesn't match the original:
From MurmurHash3_x86_32():
h1 = h1*5+0xe6546b64;
From this patch:
h1 = h1 + 5 + 0xe6546b64;
I can only assume that s/*/+ is not going to yield proper results :)
I fail to understand why you use (nblocks * 4) instead of 'len', given
that nblocks was defined as len/4
While I know that it's a fixed value, I'd rather see sizeof(uint32_t)
instead of '4' in getblock() (for readability and clarity)
As for the tests, I'd prefer them to guarantee also that the same string
hashes to the same value twice. Just in case it's not actually
deterministic :)
The tests there aren't too exhaustive, given that it only guarantees
that six pre-chosen strings don't collide.