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

Function MichaelHashMap

extern/libcds/cds/container/michael_map.h:374–383  ·  view source on GitHub ↗

Initializes the map @anchor cds_nonintrusive_MichaelHashMap_hp_ctor The Michael's hash map 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 im

Source from the content-addressed store, hash-verified

372 The ctor defines hash table size as rounding <tt>nMacItemCount / nLoadFactor</tt> up to nearest power of two.
373 */
374 MichaelHashMap(
375 size_t nMaxItemCount, ///< estimation of max item count in the hash map
376 size_t nLoadFactor ///< load factor: estimation of max number of items in the bucket
377 )
378 : m_nHashBitmask( michael_map::details::init_hash_bitmask( nMaxItemCount, nLoadFactor ))
379 , m_Buckets( bucket_table_allocator().allocate( bucket_count()))
380 {
381 for ( auto it = m_Buckets, itEnd = m_Buckets + bucket_count(); it != itEnd; ++it )
382 construct_bucket<bucket_stat>( it );
383 }
384
385 /// Clears hash map and destroys it
386 ~MichaelHashMap()

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