MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / MichaelHashSet

Function MichaelHashSet

extern/libcds/cds/container/michael_set.h:302–310  ·  view source on GitHub ↗

Initialize hash set The Michael's hash set is non-expandable container. You should point the average count of items \p nMaxItemCount when you create an object. \p nLoadFactor parameter defines average count of items per bucket and it should be small number between 1 and 10. Remember, since the bucket implementation is an ordered list, searching in the bucket is

Source from the content-addressed store, hash-verified

300 The ctor defines hash table size as rounding <tt>nMaxItemCount / nLoadFactor</tt> up to nearest power of two.
301 */
302 MichaelHashSet(
303 size_t nMaxItemCount, ///< estimation of max item count in the hash set
304 size_t nLoadFactor ///< load factor: estimation of max number of items in the bucket
305 ) : m_nHashBitmask( michael_set::details::init_hash_bitmask( nMaxItemCount, nLoadFactor ))
306 , m_Buckets( bucket_table_allocator().allocate( bucket_count()))
307 {
308 for ( auto it = m_Buckets, itEnd = m_Buckets + bucket_count(); it != itEnd; ++it )
309 construct_bucket<bucket_stat>( it );
310 }
311
312 /// Clears hash set and destroys it
313 ~MichaelHashSet()

Callers

nothing calls this directly

Calls 3

init_hash_bitmaskFunction · 0.85
bucket_countFunction · 0.70
allocateMethod · 0.45

Tested by

no test coverage detected