proxygen
|
#include <ConcurrentHashMap-detail.h>
Classes | |
class | Buckets |
class | Iterator |
Public Types | |
typedef KeyType | key_type |
typedef ValueType | mapped_type |
typedef std::pair< const KeyType, ValueType > | value_type |
typedef std::size_t | size_type |
using | Node = concurrenthashmap::NodeT< KeyType, ValueType, Allocator, Atom > |
Public Member Functions | |
ConcurrentHashMapSegment (size_t initial_buckets, float load_factor, size_t max_size) | |
~ConcurrentHashMapSegment () | |
size_t | size () |
bool | empty () |
bool | insert (Iterator &it, std::pair< key_type, mapped_type > &&foo) |
template<typename Key , typename Value > | |
bool | insert (Iterator &it, Key &&k, Value &&v) |
template<typename Key , typename... Args> | |
bool | try_emplace (Iterator &it, Key &&k, Args &&...args) |
template<typename... Args> | |
bool | emplace (Iterator &it, const KeyType &k, Node *node) |
template<typename Key , typename Value > | |
bool | insert_or_assign (Iterator &it, Key &&k, Value &&v) |
template<typename Key , typename Value > | |
bool | assign (Iterator &it, Key &&k, Value &&v) |
template<typename Key , typename Value > | |
bool | assign_if_equal (Iterator &it, Key &&k, const ValueType &expected, Value &&desired) |
template<typename MatchFunc , typename... Args> | |
bool | insert_internal (Iterator &it, const KeyType &k, InsertType type, MatchFunc match, Node *cur, Args &&...args) |
void | rehash (size_t bucket_count) |
bool | find (Iterator &res, const KeyType &k) |
size_type | erase (const key_type &key) |
size_type | erase_internal (const key_type &key, Iterator *iter) |
void | erase (Iterator &res, Iterator &pos) |
void | clear () |
void | max_load_factor (float factor) |
Iterator | cbegin () |
Iterator | cend () |
Private Types | |
enum | InsertType { InsertType::DOES_NOT_EXIST, InsertType::MUST_EXIST, InsertType::ANY, InsertType::MATCH } |
Private Member Functions | |
uint64_t | getIdx (size_t bucket_count, size_t hash) |
void | getBucketsAndCount (size_t &bcount, Buckets *&buckets, hazptr_holder< Atom > &hazptr) |
Private Attributes | |
Mutex | m_ |
float | load_factor_ |
size_t | load_factor_nodes_ |
size_t | size_ {0} |
size_t const | max_size_ |
Atom< Buckets * > | buckets_ {nullptr} |
std::atomic< uint64_t > | seqlock_ {0} |
Atom< size_t > | bucket_count_ |
Definition at line 208 of file ConcurrentHashMap-detail.h.
typedef KeyType folly::detail::ConcurrentHashMapSegment< KeyType, ValueType, ShardBits, HashFn, KeyEqual, Allocator, Atom, Mutex >::key_type |
Definition at line 219 of file ConcurrentHashMap-detail.h.
typedef ValueType folly::detail::ConcurrentHashMapSegment< KeyType, ValueType, ShardBits, HashFn, KeyEqual, Allocator, Atom, Mutex >::mapped_type |
Definition at line 220 of file ConcurrentHashMap-detail.h.
using folly::detail::ConcurrentHashMapSegment< KeyType, ValueType, ShardBits, HashFn, KeyEqual, Allocator, Atom, Mutex >::Node = concurrenthashmap::NodeT<KeyType, ValueType, Allocator, Atom> |
Definition at line 224 of file ConcurrentHashMap-detail.h.
typedef std::size_t folly::detail::ConcurrentHashMapSegment< KeyType, ValueType, ShardBits, HashFn, KeyEqual, Allocator, Atom, Mutex >::size_type |
Definition at line 222 of file ConcurrentHashMap-detail.h.
typedef std::pair<const KeyType, ValueType> folly::detail::ConcurrentHashMapSegment< KeyType, ValueType, ShardBits, HashFn, KeyEqual, Allocator, Atom, Mutex >::value_type |
Definition at line 221 of file ConcurrentHashMap-detail.h.
|
strongprivate |
Enumerator | |
---|---|
DOES_NOT_EXIST | |
MUST_EXIST | |
ANY | |
MATCH |
Definition at line 209 of file ConcurrentHashMap-detail.h.
|
inline |
Definition at line 227 of file ConcurrentHashMap-detail.h.
References folly::isPowTwo(), folly::nextPowTwo(), and folly::popcount().
|
inline |
Definition at line 243 of file ConcurrentHashMap-detail.h.
References count.
|
inline |
Definition at line 326 of file ConcurrentHashMap-detail.h.
|
inline |
Definition at line 344 of file ConcurrentHashMap-detail.h.
References testing::Args(), k, uint8_t, and v.
|
inline |
Definition at line 634 of file ConcurrentHashMap-detail.h.
References folly::detail::ConcurrentHashMapSegment< KeyType, ValueType, ShardBits, HashFn, KeyEqual, Allocator, Atom, Mutex >::Iterator::hazptrs_, folly::detail::ConcurrentHashMapSegment< KeyType, ValueType, ShardBits, HashFn, KeyEqual, Allocator, Atom, Mutex >::Iterator::next(), and folly::detail::ConcurrentHashMapSegment< KeyType, ValueType, ShardBits, HashFn, KeyEqual, Allocator, Atom, Mutex >::Iterator::setNode().
|
inline |
Definition at line 644 of file ConcurrentHashMap-detail.h.
Referenced by folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::ConstIterator::next().
|
inline |
Definition at line 614 of file ConcurrentHashMap-detail.h.
References g(), and folly::hazptr_obj_base< T, Atom, D >::retire().
|
inline |
Definition at line 297 of file ConcurrentHashMap-detail.h.
Referenced by folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::emplace().
|
inline |
Definition at line 256 of file ConcurrentHashMap-detail.h.
References folly::size().
|
inline |
Definition at line 548 of file ConcurrentHashMap-detail.h.
Referenced by folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::erase().
|
inline |
Definition at line 608 of file ConcurrentHashMap-detail.h.
References folly::padded::cend().
|
inline |
Definition at line 552 of file ConcurrentHashMap-detail.h.
References g(), h, folly::detail::ConcurrentHashMapSegment< KeyType, ValueType, ShardBits, HashFn, KeyEqual, Allocator, Atom, Mutex >::Iterator::hazptrs_, cpp.ast::next(), folly::detail::ConcurrentHashMapSegment< KeyType, ValueType, ShardBits, HashFn, KeyEqual, Allocator, Atom, Mutex >::Iterator::next(), folly::detail::concurrenthashmap::NodeT< KeyType, ValueType, Allocator, Atom >::next_, and folly::detail::ConcurrentHashMapSegment< KeyType, ValueType, ShardBits, HashFn, KeyEqual, Allocator, Atom, Mutex >::Iterator::setNode().
|
inline |
Definition at line 525 of file ConcurrentHashMap-detail.h.
References folly::detail::ConcurrentHashMapSegment< KeyType, ValueType, ShardBits, HashFn, KeyEqual, Allocator, Atom, Mutex >::Buckets::buckets_, h, folly::detail::ConcurrentHashMapSegment< KeyType, ValueType, ShardBits, HashFn, KeyEqual, Allocator, Atom, Mutex >::Iterator::hazptrs_, k, and folly::detail::ConcurrentHashMapSegment< KeyType, ValueType, ShardBits, HashFn, KeyEqual, Allocator, Atom, Mutex >::Iterator::setNode().
|
inlineprivate |
Definition at line 795 of file ConcurrentHashMap-detail.h.
References folly::hazptr_holder< Atom >::get_protected().
|
inlineprivate |
Definition at line 792 of file ConcurrentHashMap-detail.h.
|
inline |
Definition at line 260 of file ConcurrentHashMap-detail.h.
References folly::gen::move.
Referenced by folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::insert().
|
inline |
Definition at line 265 of file ConcurrentHashMap-detail.h.
References testing::Args(), k, testing::Key(), uint8_t, and v.
|
inline |
Definition at line 366 of file ConcurrentHashMap-detail.h.
References g(), h, folly::detail::ConcurrentHashMapSegment< KeyType, ValueType, ShardBits, HashFn, KeyEqual, Allocator, Atom, Mutex >::Iterator::hazptrs_, k, cpp.ast::next(), folly::detail::concurrenthashmap::NodeT< KeyType, ValueType, Allocator, Atom >::next_, and folly::detail::ConcurrentHashMapSegment< KeyType, ValueType, ShardBits, HashFn, KeyEqual, Allocator, Atom, Mutex >::Iterator::setNode().
|
inline |
Definition at line 308 of file ConcurrentHashMap-detail.h.
Referenced by folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::insert_or_assign().
|
inline |
Definition at line 627 of file ConcurrentHashMap-detail.h.
References g().
|
inline |
Definition at line 468 of file ConcurrentHashMap-detail.h.
References count, h, i, and k.
|
inline |
Definition at line 252 of file ConcurrentHashMap-detail.h.
|
inline |
Definition at line 283 of file ConcurrentHashMap-detail.h.
References testing::Args(), and k.
Referenced by folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::try_emplace().
|
private |
Definition at line 820 of file ConcurrentHashMap-detail.h.
|
private |
Definition at line 818 of file ConcurrentHashMap-detail.h.
|
private |
Definition at line 812 of file ConcurrentHashMap-detail.h.
|
private |
Definition at line 813 of file ConcurrentHashMap-detail.h.
|
private |
Definition at line 811 of file ConcurrentHashMap-detail.h.
|
private |
Definition at line 815 of file ConcurrentHashMap-detail.h.
|
private |
Definition at line 819 of file ConcurrentHashMap-detail.h.
|
private |
Definition at line 814 of file ConcurrentHashMap-detail.h.