|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
Functions | |
| template<class Bucket > | |
| size_t | checked_table_len (const size_t len) |
Checks that the bytes of a table of buckets fit in a size_t. | |
| template<class Bucket > | |
| size_t | prime_table_len (const size_t len) |
The length of a table for a request of len buckets: the next prime. | |
| template<class Bucket > | |
| void | free_bucket_not_taken (Bucket *bucket) noexcept |
| Frees a bucket that a hash table of lists was given and did not take. | |
| template<class Cmp > | |
| void | swap_compare (Cmp &a, Cmp &b) noexcept |
| Swaps the comparators of two hash tables. | |
|
inline |
Checks that the bytes of a table of buckets fit in a size_t.
For a count of buckets whose bytes do not fit, what new[] asks of the allocator depends on the compiler: some ask for the largest size_t, which under a sanitizer ends the program.
| Bucket | the type of the buckets of the table. |
| [in] | len | the count of buckets. |
len. | std::overflow_error | if the bytes of len buckets do not fit in a size_t. |
Definition at line 82 of file hashDry.H.
References ah_overflow_error_if.
|
inline |
The length of a table for a request of len buckets: the next prime.
The request is checked before it is taken to a prime, which past the table of primes is searched by trial division, and the prime after it.
| Bucket | the type of the buckets of the table. |
| [in] | len | the buckets asked for. |
len or more. | std::overflow_error | if the bytes of len buckets, or of that prime, do not fit in a size_t. |
Definition at line 102 of file hashDry.H.
References Primes::next_prime().