Commit d6ddc282 authored by Jim Meyering's avatar Jim Meyering Committed by Viswanath Sivakumar

folly/AtomicHashArray: use an unsigned type for each of two counters

Summary:
* folly/AtomicHashArray.h (numEntries_, numPendingEntries_):
Use an unsigned type for each of these.  They count things, can
never go below 0, and are compared to unsigned values.
Otherwise, gcc-4.9 would emit this:
folly/AtomicHashArray-inl.h:153:38: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]

Test Plan:
Run this and note there are fewer errors than before:
fbconfig --platform-all=gcc-4.9-glibc-2.20 -r folly && fbmake dbgo

Reviewed By: philipp@fb.com

Subscribers: trunkagent, folly-diffs@

FB internal diff: D1770695

Tasks: 5941250

Signature: t1:1770695:1420683354:bfa4775bc2f8aab74e34772308a5c8b1779243b8
parent 69e1c7dc
......@@ -265,8 +265,8 @@ class AtomicHashArray : boost::noncopyable {
// reading the value, so be careful of calling size() too frequently. This
// increases insertion throughput several times over while keeping the count
// accurate.
ThreadCachedInt<int64_t> numEntries_; // Successful key inserts
ThreadCachedInt<int64_t> numPendingEntries_; // Used by insertInternal
ThreadCachedInt<uint64_t> numEntries_; // Successful key inserts
ThreadCachedInt<uint64_t> numPendingEntries_; // Used by insertInternal
std::atomic<int64_t> isFull_; // Used by insertInternal
std::atomic<int64_t> numErases_; // Successful key erases
......
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