folly/MPMCQueue sizeGuess should return a signed int
authorNathan Bronson <ngbronson@fb.com>
Fri, 19 Jul 2013 18:12:59 +0000 (11:12 -0700)
committerSara Golemon <sgolemon@fb.com>
Wed, 28 Aug 2013 21:30:10 +0000 (14:30 -0700)
Summary:
Like size(), sizeGuess() is allowed to return a negative value,
so it should be ssize_t instead of uint64_t.

Test Plan: fbmake, wait for contbuild

Reviewed By: tudorb@fb.com

FB internal diff: D893075

folly/MPMCQueue.h

index 9fb7867fdbe32c50a4931685eb37ffa713164aeb..58c1d3cef08f3af9e5af1126f2bb6001c226bd4e 100644 (file)
@@ -196,7 +196,7 @@ class MPMCQueue : boost::noncopyable {
 
   /// Returns is a guess at size() for contexts that don't need a precise
   /// value, such as stats.
-  uint64_t sizeGuess() const noexcept {
+  ssize_t sizeGuess() const noexcept {
     return writeCount() - readCount();
   }