Barrelfish
Macros | Functions
hashtable.c File Reference

Hashtable implementation. More...

Macros

#define equals(_k1, _k2, len)   (!memcmp((_k1), (_k2), (len)))
 check two keys for equality More...
 

Functions

struct hashtablecreate_hashtable2 (int capacity, int load_factor)
 create an empty hashtable with a given capacity and load factor More...
 
struct hashtablecreate_hashtable (void)
 create an empty hashtable with default capacity and load factor More...
 

Detailed Description

Hashtable implementation.

Macro Definition Documentation

#define equals (   _k1,
  _k2,
  len 
)    (!memcmp((_k1), (_k2), (len)))

check two keys for equality

Parameters
k1the first string
k2the second string
Returns
true if the strings are equal

Function Documentation

struct hashtable* create_hashtable ( void  )

create an empty hashtable with default capacity and load factor

Returns
an empty hashtable
struct hashtable* create_hashtable2 ( int  capacity,
int  loadFactor 
)

create an empty hashtable with a given capacity and load factor

Parameters
capacitythe capacity
theload factor
Returns
an empty hashtable.