From: Brian Watling Date: Wed, 20 May 2015 01:38:38 +0000 (-0700) Subject: Make AtomicHashMap shadow declaration clean X-Git-Tag: v0.39.0~2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e1c9764467c8c40c427c4b158342ba3642fe10a8;p=folly.git 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 --- diff --git a/folly/AtomicHashArray-inl.h b/folly/AtomicHashArray-inl.h index c21c1dce..d455bbce 100644 --- a/folly/AtomicHashArray-inl.h +++ b/folly/AtomicHashArray-inl.h @@ -28,8 +28,9 @@ template AtomicHashArray:: AtomicHashArray(size_t capacity, KeyT emptyKey, KeyT lockedKey, - KeyT erasedKey, double maxLoadFactor, size_t cacheSize) - : capacity_(capacity), maxEntries_(size_t(maxLoadFactor * capacity_ + 0.5)), + KeyT erasedKey, double _maxLoadFactor, size_t cacheSize) + : capacity_(capacity), + maxEntries_(size_t(_maxLoadFactor * capacity_ + 0.5)), kEmptyKey_(emptyKey), kLockedKey_(lockedKey), kErasedKey_(erasedKey), kAnchorMask_(nextPowTwo(capacity_) - 1), numEntries_(0, cacheSize), numPendingEntries_(0, cacheSize), isFull_(0), numErases_(0) { diff --git a/folly/AtomicHashMap-inl.h b/folly/AtomicHashMap-inl.h index 12afb82d..4752cdd3 100644 --- a/folly/AtomicHashMap-inl.h +++ b/folly/AtomicHashMap-inl.h @@ -32,14 +32,14 @@ AtomicHashMap::defaultConfig; template AtomicHashMap:: -AtomicHashMap(size_t size, const Config& config) +AtomicHashMap(size_t finalSizeEst, const Config& config) : kGrowthFrac_(config.growthFactor < 0 ? 1.0 - config.maxLoadFactor : config.growthFactor) { 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); - auto numSubMaps = kNumSubMaps_; - FOR_EACH_RANGE(i, 1, numSubMaps) { + auto subMapCount = kNumSubMaps_; + FOR_EACH_RANGE(i, 1, subMapCount) { subMaps_[i].store(nullptr, std::memory_order_relaxed); } numMapsAllocated_.store(1, std::memory_order_relaxed);