Hash table control structure.
The hash table keeps track of information about a hash table, as well as the actual hash table itself.
- Notes:
- 1. Pointer to the hash table proper. The table is an array of pointers to hash nodes (of type hnode_t). If the table is empty, every element of this table is a null pointer. A non-null entry points to the first element of a chain of nodes.
2. Minimum and initial size of the hash table (must be a power of two).
3. Maximum hash table size (must be >= minsize). The maximum size is the greatest number of nodes that can populate this table. If the table contains this many nodes, no more can be inserted, and the hash_isfull() function returns true.
4. The low mark is a minimum population threshold, measured as a number of nodes. If the table population drops below this value, a table shrinkage will occur. Only dynamic tables are subject to this reduction. No table will shrink beneath a certain absolute minimum number of nodes.
5. The high mark is a population threshold, measured as a number of nodes, which, if exceeded, will trigger a table expansion. Only dynamic hash tables are subject to this expansion.
6. This member keeps track of the size of the hash table—that is, the number of chain pointers.
7. The current hash table mask. If the size of the hash table is 2^N, this value has its low N bits set to 1, and the others clear. It is used to select bits from the result of the hashing function to compute an index into the table.
8. The count member maintains the number of elements that are presently in the hash table.
9. This is the a pointer to the hash table's comparison function. The function is set once at initialization or creation time.
10. Pointer to the table's hashing function, set once at creation or initialization time.
12. User data deallocator. Default is NULL. (i.e. nothing is done to data when hash node is deleted).
13. A flag which indicates whether the table is to be dynamically resized. It is set to 1 in dynamically allocated tables, 0 in tables that are statically allocated.
Definition at line 267 of file hash.h.