mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 17:10:50 +00:00
ARM: Fix 64 bit unaligned access in MurmurHash64A().
This commit is contained in:
parent
f917e0da4c
commit
1e272a6b52
@ -206,4 +206,10 @@ void setproctitle(const char *fmt, ...);
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Make sure we can test for ARM just checking for __arm__, since sometimes
|
||||||
|
* __arm is defined but __arm__ is not. */
|
||||||
|
#if defined(__arm) && !defined(__arm__)
|
||||||
|
#define __arm__
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -401,7 +401,11 @@ uint64_t MurmurHash64A (const void * key, int len, unsigned int seed) {
|
|||||||
uint64_t k;
|
uint64_t k;
|
||||||
|
|
||||||
#if (BYTE_ORDER == LITTLE_ENDIAN)
|
#if (BYTE_ORDER == LITTLE_ENDIAN)
|
||||||
|
#ifdef __arm__
|
||||||
|
memcpy(&k,data,sizeof(uint64_t));
|
||||||
|
#else
|
||||||
k = *((uint64_t*)data);
|
k = *((uint64_t*)data);
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
k = (uint64_t) data[0];
|
k = (uint64_t) data[0];
|
||||||
k |= (uint64_t) data[1] << 8;
|
k |= (uint64_t) data[1] << 8;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user