libosmocore
1.5.1
Osmocom core library
|
Go to the documentation of this file.
7 #if ULONG_MAX == 4294967295
8 #define BITS_PER_LONG 32
10 #define BITS_PER_LONG 64
18 #if BITS_PER_LONG == 32
19 #define GOLDEN_RATIO_PRIME GOLDEN_RATIO_32
20 #define hash_long(val, bits) hash_32(val, bits)
21 #elif BITS_PER_LONG == 64
22 #define hash_long(val, bits) hash_64(val, bits)
23 #define GOLDEN_RATIO_PRIME GOLDEN_RATIO_64
25 #error Wordsize not 32 or 64
45 #define GOLDEN_RATIO_32 0x61C88647
46 #define GOLDEN_RATIO_64 0x61C8864680B583EBull
56 #ifndef HAVE_ARCH__HASH_32
57 #define __hash_32 __hash_32_generic
64 #ifndef HAVE_ARCH_HASH_32
65 #define hash_32 hash_32_generic
73 #ifndef HAVE_ARCH_HASH_64
74 #define hash_64 hash_64_generic
78 #if BITS_PER_LONG == 64
87 static inline uint32_t
hash_ptr(
const void *ptr,
unsigned int bits)
89 return hash_long((
unsigned long)ptr, bits);
95 unsigned long val = (
unsigned long)ptr;
97 #if BITS_PER_LONG == 64
100 return (uint32_t)val;
#define hash_long(val, bits)
Definition: hash.h:22
#define __hash_32
Definition: hash.h:57
static uint32_t __hash_32_generic(uint32_t val)
Definition: hash.h:59
#define GOLDEN_RATIO_32
Definition: hash.h:45
static uint32_t hash_32_generic(uint32_t val, unsigned int bits)
Definition: hash.h:67
#define __always_inline
Definition: conv_acc_neon_impl.h:30
#define hash_32
Definition: hash.h:65
#define GOLDEN_RATIO_64
Definition: hash.h:46
static uint32_t hash32_ptr(const void *ptr)
Definition: hash.h:93
static uint32_t hash_ptr(const void *ptr, unsigned int bits)
Definition: hash.h:87
static __always_inline uint32_t hash_64_generic(uint64_t val, unsigned int bits)
Definition: hash.h:76