prg_bin_hash_table_create()
Abstract
Creates a new hash table.
Syntax
prg_bin_hash_table_create (bin_log_hash_size, key_length)
| Argument | Type | Description |
|---|---|---|
bin_log_hash_size |
OpT_uInt32 |
The base-2 log of the desired size (in cells) of the hash table. Must be <= 30 (approximately 1 billion cells). A larger number of cells will decrease the probability of a collision at the cost of increased memory usage when the hash table is sparsely populated. |
key_length |
OpT_uInt32 |
The maximum number of bytes from the key that should be used when computing the hash value. A larger number of bytes will help minimize the number of collisions at the cost of increasing the hash function computation time. |
Return Type
PrgT_Bin_Hash_Table *
The newly created hash table.
Header
prg_bin_hash.h
Details
For maximum efficiency, the size of the hash table must be a power of 2. To ensure this, bin_log_hash_size is specified as the base-2 log of the desired size.
WARNING: This function is MT unsafe, as described in “Multi-Threading Safety“ on page 11. Access to shared hash tables must be externally serialized.