Increase 8 times number of WaitFreeMap storages.

This commit is contained in:
levlam 2022-09-22 07:13:17 +03:00
parent 2a41ab0562
commit 5c5d19e76f
2 changed files with 6 additions and 4 deletions

View File

@ -17,9 +17,10 @@ namespace td {
template <class KeyT, class ValueT, class HashT = std::hash<KeyT>, class EqT = std::equal_to<KeyT>>
class WaitFreeHashMap {
using Storage = FlatHashMap<KeyT, ValueT, HashT, EqT>;
static constexpr size_t MAX_STORAGE_COUNT = 256;
static constexpr size_t MAX_STORAGE_COUNT = 1 << 11;
static_assert((MAX_STORAGE_COUNT & (MAX_STORAGE_COUNT - 1)) == 0, "");
static constexpr size_t MAX_STORAGE_SIZE = MAX_STORAGE_COUNT * MAX_STORAGE_COUNT / 2;
static constexpr size_t MAX_STORAGE_SIZE = 1 << 17;
static_assert((MAX_STORAGE_SIZE & (MAX_STORAGE_SIZE - 1)) == 0, "");
Storage default_map_;
struct WaitFreeStorage {

View File

@ -17,9 +17,10 @@ namespace td {
template <class KeyT, class HashT = std::hash<KeyT>, class EqT = std::equal_to<KeyT>>
class WaitFreeHashSet {
using Storage = FlatHashSet<KeyT, HashT, EqT>;
static constexpr size_t MAX_STORAGE_COUNT = 256;
static constexpr size_t MAX_STORAGE_COUNT = 1 << 11;
static_assert((MAX_STORAGE_COUNT & (MAX_STORAGE_COUNT - 1)) == 0, "");
static constexpr size_t MAX_STORAGE_SIZE = MAX_STORAGE_COUNT * MAX_STORAGE_COUNT / 2;
static constexpr size_t MAX_STORAGE_SIZE = 1 << 17;
static_assert((MAX_STORAGE_SIZE & (MAX_STORAGE_SIZE - 1)) == 0, "");
Storage default_set_;
struct WaitFreeStorage {