diff --git a/Utilities/lockless.h b/Utilities/lockless.h index 10674d3c17..8745408dd0 100644 --- a/Utilities/lockless.h +++ b/Utilities/lockless.h @@ -98,49 +98,6 @@ public: } }; -//! Simple lock-free map. Based on lf_array<>. All elements are accessible, implicitly initialized. -template, std::size_t Size = 256> -class lf_hashmap -{ - struct pair_t - { - // Default-constructed key means "no key" - atomic_t key{}; - T value{}; - }; - - // - lf_array m_data{}; - - // Value for default-constructed key - T m_default_key_data{}; - -public: - constexpr lf_hashmap() = default; - - // Access element (added implicitly) - T& operator [](const K& key) - { - if (key == K{}) [[unlikely]] - { - return m_default_key_data; - } - - // Calculate hash and array position - for (std::size_t pos = Hash{}(key) % Size;; pos += Size) - { - // Access the array - auto& pair = m_data[pos]; - - // Check the key value (optimistic) - if (pair.key == key || pair.key.compare_and_swap_test(K{}, key)) [[likely]] - { - return pair.value; - } - } - } -}; - // Helper type, linked list element template class lf_queue_item final