Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
980d8805
Commit
980d8805
authored
Feb 19, 2017
by
Salvatore Sanfilippo
Committed by
antirez
Feb 21, 2017
Browse files
ARM: Fix 64 bit unaligned access in MurmurHash64A().
parent
522b10e4
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/config.h
View file @
980d8805
...
...
@@ -206,4 +206,10 @@ void setproctitle(const char *fmt, ...);
#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
src/hyperloglog.c
View file @
980d8805
...
...
@@ -401,7 +401,11 @@ uint64_t MurmurHash64A (const void * key, int len, unsigned int seed) {
uint64_t
k
;
#if (BYTE_ORDER == LITTLE_ENDIAN)
#ifdef __arm__
memcpy
(
&
k
,
data
,
sizeof
(
uint64_t
));
#else
k
=
*
((
uint64_t
*
)
data
);
#endif
#else
k
=
(
uint64_t
)
data
[
0
];
k
|=
(
uint64_t
)
data
[
1
]
<<
8
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment