projects
/
awesomized
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
testing
[awesomized/libmemcached]
/
src
/
libhashkit
/
jenkins.cc
diff --git
a/src/libhashkit/jenkins.cc
b/src/libhashkit/jenkins.cc
index 3c6558a42ad9a21d9980dcb8983056f9dd073e1e..65aa1d11c6110269fc46e0bf7ea20e098a45200a 100644
(file)
--- a/
src/libhashkit/jenkins.cc
+++ b/
src/libhashkit/jenkins.cc
@@
-1,5
+1,5
@@
/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
- *
+ *
* HashKit library
*
* Copyright (C) 2011-2012 Data Differential, http://datadifferential.com/
* HashKit library
*
* Copyright (C) 2011-2012 Data Differential, http://datadifferential.com/
@@
-48,7
+48,7
@@
* Add big endian support
*/
* Add big endian support
*/
-#include
<libhashkit/common.h>
+#include
"libhashkit/common.h"
#define hashsize(n) ((uint32_t)1<<(n))
#define hashmask(n) (hashsize(n)-1)
#define hashsize(n) ((uint32_t)1<<(n))
#define hashmask(n) (hashsize(n)-1)
@@
-93,10
+93,13
@@
use a bitmask. For example, if you need only 10 bits, do
In which case, the hash table should have hashsize(10) elements.
*/
In which case, the hash table should have hashsize(10) elements.
*/
+#if HAVE_ASAN
+__attribute__((no_sanitize_address,no_sanitize("address")))
+#endif
uint32_t hashkit_jenkins(const char *key, size_t length, void *)
{
uint32_t a,b,c; /* internal state */
uint32_t hashkit_jenkins(const char *key, size_t length, void *)
{
uint32_t a,b,c; /* internal state */
-#if
ndef
WORDS_BIGENDIAN
+#if
!
WORDS_BIGENDIAN
union { const void *ptr; size_t i; } u;
u.ptr = key;
#endif
union { const void *ptr; size_t i; } u;
u.ptr = key;
#endif
@@
-104,7
+107,7
@@
uint32_t hashkit_jenkins(const char *key, size_t length, void *)
/* Set up the internal state */
a = b = c = 0xdeadbeef + ((uint32_t)length) + JENKINS_INITVAL;
/* Set up the internal state */
a = b = c = 0xdeadbeef + ((uint32_t)length) + JENKINS_INITVAL;
-#if
ndef
WORDS_BIGENDIAN
+#if
!
WORDS_BIGENDIAN
if ((u.i & 0x3) == 0)
{
const uint32_t *k = (const uint32_t *)key; /* read 32-bit chunks */
if ((u.i & 0x3) == 0)
{
const uint32_t *k = (const uint32_t *)key; /* read 32-bit chunks */
@@
-259,7
+262,7
@@
uint32_t hashkit_jenkins(const char *key, size_t length, void *)
case 0 : return c;
default : return c;
}
case 0 : return c;
default : return c;
}
-#if
ndef
WORDS_BIGENDIAN
+#if
!
WORDS_BIGENDIAN
}
#endif
}
#endif