libFirm
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Hash Functions

Functions

static unsigned hash_data (unsigned char const *data, size_t bytes)
 Returns a hash value for a block of data. More...
 
static unsigned hash_str (char const *const str)
 Returns a hash value for a string. More...
 
static unsigned hash_ptr (void const *const ptr)
 Returns a hash value for a pointer. More...
 
static unsigned hash_combine (unsigned const x, unsigned const y)
 Combines 2 hash values. More...
 

Detailed Description

Function Documentation

static unsigned hash_combine ( unsigned const  x,
unsigned const  y 
)
inlinestatic

Combines 2 hash values.

Parameters
xOne hash value.
yAnother hash value.
Returns
A hash value computed from both.

Definition at line 77 of file hashptr.h.

static unsigned hash_data ( unsigned char const *  data,
size_t  bytes 
)
inlinestatic

Returns a hash value for a block of data.

Definition at line 34 of file hashptr.h.

static unsigned hash_ptr ( void const *const  ptr)
inlinestatic

Returns a hash value for a pointer.

Pointer addresses are mostly aligned to 4 or 8 bytes. So we remove the lowest 3 bits.

Definition at line 66 of file hashptr.h.

static unsigned hash_str ( char const *const  str)
inlinestatic

Returns a hash value for a string.

Parameters
strThe string (can be const).
Returns
A hash value for the string.

Definition at line 50 of file hashptr.h.