libFirm
Hash Functions

Functions

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

Detailed Description

Function Documentation

static unsigned hash_combine ( unsigned  x,
unsigned  y 
)
inlinestatic

Combines 2 hash values.

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

Definition at line 97 of file hashptr.h.

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

Returns a hash value for a block of data.

Definition at line 50 of file hashptr.h.

static unsigned hash_ptr ( const void *  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 86 of file hashptr.h.

static unsigned hash_str ( const char *  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 68 of file hashptr.h.