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.

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.

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · Documentation compiled and provided by Beijing ZNetLink Technology Co., Ltd.

交流群 · QQ Group:OPNET/智网妙算网络仿真交流群(群号 486383494)

原文档 © 2017 Riverbed Technology · 本站为公益翻译,由 AI 辅助完成,请仔细甄别

Original documentation © 2017 Riverbed Technology. Community translation, AI-assisted. Contact: jiazequn@znetlink.com