Commit e1c97644 authored by Brian Watling's avatar Brian Watling Committed by Viswanath Sivakumar

Make AtomicHashMap shadow declaration clean

Summary: Some of AtomicHashMap's locals shadow member functions - rename the locals to fix the warnings

Test Plan: unit tests

Reviewed By: chaoc@fb.com

Subscribers: folly-diffs@, yfeldblum, chalfant, tao-eng@

FB internal diff: D2086270

Signature: t1:2086270:1432083900:fae1be39e55e4c30b47fdc7a069bb13d75292b0a
parent 0e7cb3fe
...@@ -28,8 +28,9 @@ template <class KeyT, class ValueT, ...@@ -28,8 +28,9 @@ template <class KeyT, class ValueT,
class HashFcn, class EqualFcn, class Allocator> class HashFcn, class EqualFcn, class Allocator>
AtomicHashArray<KeyT, ValueT, HashFcn, EqualFcn, Allocator>:: AtomicHashArray<KeyT, ValueT, HashFcn, EqualFcn, Allocator>::
AtomicHashArray(size_t capacity, KeyT emptyKey, KeyT lockedKey, AtomicHashArray(size_t capacity, KeyT emptyKey, KeyT lockedKey,
KeyT erasedKey, double maxLoadFactor, size_t cacheSize) KeyT erasedKey, double _maxLoadFactor, size_t cacheSize)
: capacity_(capacity), maxEntries_(size_t(maxLoadFactor * capacity_ + 0.5)), : capacity_(capacity),
maxEntries_(size_t(_maxLoadFactor * capacity_ + 0.5)),
kEmptyKey_(emptyKey), kLockedKey_(lockedKey), kErasedKey_(erasedKey), kEmptyKey_(emptyKey), kLockedKey_(lockedKey), kErasedKey_(erasedKey),
kAnchorMask_(nextPowTwo(capacity_) - 1), numEntries_(0, cacheSize), kAnchorMask_(nextPowTwo(capacity_) - 1), numEntries_(0, cacheSize),
numPendingEntries_(0, cacheSize), isFull_(0), numErases_(0) { numPendingEntries_(0, cacheSize), isFull_(0), numErases_(0) {
......
...@@ -32,14 +32,14 @@ AtomicHashMap<KeyT, ValueT, HashFcn, EqualFcn, Allocator>::defaultConfig; ...@@ -32,14 +32,14 @@ AtomicHashMap<KeyT, ValueT, HashFcn, EqualFcn, Allocator>::defaultConfig;
template <typename KeyT, typename ValueT, template <typename KeyT, typename ValueT,
typename HashFcn, typename EqualFcn, typename Allocator> typename HashFcn, typename EqualFcn, typename Allocator>
AtomicHashMap<KeyT, ValueT, HashFcn, EqualFcn, Allocator>:: AtomicHashMap<KeyT, ValueT, HashFcn, EqualFcn, Allocator>::
AtomicHashMap(size_t size, const Config& config) AtomicHashMap(size_t finalSizeEst, const Config& config)
: kGrowthFrac_(config.growthFactor < 0 ? : kGrowthFrac_(config.growthFactor < 0 ?
1.0 - config.maxLoadFactor : config.growthFactor) { 1.0 - config.maxLoadFactor : config.growthFactor) {
CHECK(config.maxLoadFactor > 0.0 && config.maxLoadFactor < 1.0); CHECK(config.maxLoadFactor > 0.0 && config.maxLoadFactor < 1.0);
subMaps_[0].store(SubMap::create(size, config).release(), subMaps_[0].store(SubMap::create(finalSizeEst, config).release(),
std::memory_order_relaxed); std::memory_order_relaxed);
auto numSubMaps = kNumSubMaps_; auto subMapCount = kNumSubMaps_;
FOR_EACH_RANGE(i, 1, numSubMaps) { FOR_EACH_RANGE(i, 1, subMapCount) {
subMaps_[i].store(nullptr, std::memory_order_relaxed); subMaps_[i].store(nullptr, std::memory_order_relaxed);
} }
numMapsAllocated_.store(1, std::memory_order_relaxed); numMapsAllocated_.store(1, std::memory_order_relaxed);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment