X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Fhashtable%2Futils.c;h=eb51554b2e3d56daa5c2eb872e3069cdcfa8c886;hb=3afa94aeca5a0daae40fd7b6cc96b7e4c150c7d8;hp=2d027bae0b9cc2350ea69337ea3412dd5727d79d;hpb=ab5be9fa2eb5ba9600a82cd18fd3cfcbac69169a;p=lttng-tools.git diff --git a/src/common/hashtable/utils.c b/src/common/hashtable/utils.c index 2d027bae0..eb51554b2 100644 --- a/src/common/hashtable/utils.c +++ b/src/common/hashtable/utils.c @@ -40,7 +40,6 @@ */ #define _LGPL_SOURCE -#include #include /* defines uint32_t etc */ #include /* defines printf for tests */ #include @@ -264,7 +263,9 @@ static void __attribute__((unused)) hashword2(const uint32_t *k, size_t length, * Use for hash table lookup, or anything where one collision in 2^^32 is * acceptable. Do NOT use for cryptographic purposes. */ -static uint32_t __attribute__((unused)) hashlittle(const void *key, +LTTNG_NO_SANITIZE_ADDRESS +__attribute__((unused)) +static uint32_t hashlittle(const void *key, size_t length, uint32_t initval) { uint32_t a,b,c; @@ -438,7 +439,6 @@ static uint32_t __attribute__((unused)) hashlittle(const void *key, return c; } -LTTNG_HIDDEN unsigned long hash_key_u64(const void *_key, unsigned long seed) { union { @@ -461,7 +461,6 @@ unsigned long hash_key_u64(const void *_key, unsigned long seed) * Hash function for number value. * Pass the value itself as the key, not its address. */ -LTTNG_HIDDEN unsigned long hash_key_ulong(const void *_key, unsigned long seed) { uint64_t __key = (uint64_t) _key; @@ -472,7 +471,6 @@ unsigned long hash_key_ulong(const void *_key, unsigned long seed) * Hash function for number value. * Pass the value itself as the key, not its address. */ -LTTNG_HIDDEN unsigned long hash_key_ulong(const void *_key, unsigned long seed) { uint32_t key = (uint32_t) _key; @@ -484,7 +482,6 @@ unsigned long hash_key_ulong(const void *_key, unsigned long seed) /* * Hash function for string. */ -LTTNG_HIDDEN unsigned long hash_key_str(const void *key, unsigned long seed) { return hashlittle(key, strlen((const char *) key), seed); @@ -493,7 +490,6 @@ unsigned long hash_key_str(const void *key, unsigned long seed) /* * Hash function for two uint64_t. */ -LTTNG_HIDDEN unsigned long hash_key_two_u64(const void *key, unsigned long seed) { const struct lttng_ht_two_u64 *k = @@ -505,7 +501,6 @@ unsigned long hash_key_two_u64(const void *key, unsigned long seed) /* * Hash function compare for number value. */ -LTTNG_HIDDEN int hash_match_key_ulong(const void *key1, const void *key2) { if (key1 == key2) { @@ -518,7 +513,6 @@ int hash_match_key_ulong(const void *key1, const void *key2) /* * Hash function compare for number value. */ -LTTNG_HIDDEN int hash_match_key_u64(const void *key1, const void *key2) { if (*(const uint64_t *) key1 == *(const uint64_t *) key2) { @@ -531,7 +525,6 @@ int hash_match_key_u64(const void *key1, const void *key2) /* * Hash compare function for string. */ -LTTNG_HIDDEN int hash_match_key_str(const void *key1, const void *key2) { if (strcmp(key1, key2) == 0) { @@ -544,7 +537,6 @@ int hash_match_key_str(const void *key1, const void *key2) /* * Hash function compare two uint64_t. */ -LTTNG_HIDDEN int hash_match_key_two_u64(const void *key1, const void *key2) { const struct lttng_ht_two_u64 *k1 =