libosmocore  1.5.1
Osmocom core library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
hash.h File Reference
#include <osmocom/core/log2.h>
#include <limits.h>

Go to the source code of this file.

Macros

#define BITS_PER_LONG   64
 
#define hash_long(val, bits)   hash_64(val, bits)
 
#define GOLDEN_RATIO_PRIME   GOLDEN_RATIO_64
 
#define GOLDEN_RATIO_32   0x61C88647
 
#define GOLDEN_RATIO_64   0x61C8864680B583EBull
 
#define __hash_32   __hash_32_generic
 
#define hash_32   hash_32_generic
 
#define hash_64   hash_64_generic
 

Functions

static uint32_t __hash_32_generic (uint32_t val)
 
static uint32_t hash_32_generic (uint32_t val, unsigned int bits)
 
static __always_inline uint32_t hash_64_generic (uint64_t val, unsigned int bits)
 
static uint32_t hash_ptr (const void *ptr, unsigned int bits)
 
static uint32_t hash32_ptr (const void *ptr)
 

Macro Definition Documentation

#define __hash_32   __hash_32_generic

Referenced by hash_32_generic(), and hash_64_generic().

#define BITS_PER_LONG   64
#define GOLDEN_RATIO_32   0x61C88647

Referenced by __hash_32_generic().

#define GOLDEN_RATIO_64   0x61C8864680B583EBull

Referenced by hash_64_generic().

#define GOLDEN_RATIO_PRIME   GOLDEN_RATIO_64
#define hash_32   hash_32_generic

Referenced by hash_64_generic().

#define hash_64   hash_64_generic
#define hash_long (   val,
  bits 
)    hash_64(val, bits)

Referenced by hash_ptr().

Function Documentation

static uint32_t __hash_32_generic ( uint32_t  val)
inlinestatic

References GOLDEN_RATIO_32.

static uint32_t hash32_ptr ( const void *  ptr)
inlinestatic
static uint32_t hash_32_generic ( uint32_t  val,
unsigned int  bits 
)
inlinestatic

References __hash_32.

static __always_inline uint32_t hash_64_generic ( uint64_t  val,
unsigned int  bits 
)
static

References __hash_32, GOLDEN_RATIO_64, and hash_32.

static uint32_t hash_ptr ( const void *  ptr,
unsigned int  bits 
)
inlinestatic

References hash_long.