added stats to boost::concurrent_flat_map

This commit is contained in:
joaquintides
2024-04-29 12:06:50 +02:00
parent 443113840d
commit 1ecb92deb5

View File

@ -1,7 +1,7 @@
/* Fast open-addressing concurrent hashmap.
*
* Copyright 2023 Christian Mazakas.
* Copyright 2023 Joaquin M Lopez Munoz.
* Copyright 2023-2024 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
@ -75,6 +75,10 @@ namespace boost {
typename boost::allocator_const_pointer<allocator_type>::type;
static constexpr size_type bulk_visit_size = table_type::bulk_visit_size;
#if defined(BOOST_UNORDERED_ENABLE_STATS)
using stats = typename table_type::stats;
#endif
concurrent_flat_map()
: concurrent_flat_map(detail::foa::default_bucket_count)
{
@ -714,6 +718,15 @@ namespace boost {
void rehash(size_type n) { table_.rehash(n); }
void reserve(size_type n) { table_.reserve(n); }
#if defined(BOOST_UNORDERED_ENABLE_STATS)
/// Stats
///
stats get_stats() const { return table_.get_stats(); }
void reset_stats() { table_.reset_stats(); }
#endif
/// Observers
///
allocator_type get_allocator() const noexcept