added stats to boost::concurrent_flat_set

This commit is contained in:
joaquintides 2024-04-29 20:32:27 +02:00
parent 76c460a703
commit 9806e75cc9

View File

@ -1,7 +1,7 @@
/* Fast open-addressing concurrent hashset.
*
* 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)
@ -72,6 +72,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_set()
: concurrent_flat_set(detail::foa::default_bucket_count)
{
@ -582,6 +586,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