multibit, fatbit: make _size build-time only

This commit makes mmbit_size() and fatbit_size compile-time only, and
adds a resource limit for very large multibits.
This commit is contained in:
Justin Viiret
2016-12-05 16:20:52 +11:00
committed by Matthew Barr
parent 8b7b06d2a4
commit e271781d95
19 changed files with 201 additions and 129 deletions

View File

@@ -50,6 +50,15 @@ size_t hash_value(const mmbit_sparse_iter &iter) {
namespace ue2 {
/**
* \brief Return the size in bytes of a multibit that can store the given
* number of bits.
*
* This will throw a resource limit assertion if the requested mmbit is too
* large.
*/
u32 mmbit_size(u32 total_bits);
/** \brief Construct a sparse iterator over the values in \a bits for a
* multibit of size \a total_bits. */
void mmbBuildSparseIterator(std::vector<mmbit_sparse_iter> &out,