#include <cds/algo/bitop.h>
#include <cds/opt/hash.h>
#include <cds/intrusive/free_list_selector.h>
+#include <cds/details/size_t_cast.h>
namespace cds { namespace intrusive {
the <tt>empty()</tt> member function depends on correct item counting.
Therefore, \p cds::atomicity::empty_item_counter is not allowed as a type of the option.
- Default is \p cds::atomicity::item_counter.
+ Default is \p cds::atomicity::item_counter; to avoid false sharing you may use \p atomicity::cache_friendly_item_counter
*/
typedef cds::atomicity::item_counter item_counter;
template <typename BitReversalAlgo>
static inline size_t regular_hash( size_t nHash )
{
- return BitReversalAlgo()( nHash ) | size_t(1);
+ return static_cast<size_t>( BitReversalAlgo()( cds::details::size_t_cast( nHash ))) | size_t(1);
}
template <typename BitReversalAlgo>
static inline size_t dummy_hash( size_t nHash )
{
- return BitReversalAlgo()( nHash ) & ~size_t(1);
+ return static_cast<size_t>( BitReversalAlgo()( cds::details::size_t_cast( nHash ))) & ~size_t(1);
}
//@endcond