added a missing hook to IndexedMemPool's testing harness
authorNathan Bronson <ngbronson@fb.com>
Fri, 24 Jul 2015 21:57:33 +0000 (14:57 -0700)
committerfacebook-github-bot-4 <folly-bot@fb.com>
Fri, 24 Jul 2015 22:22:14 +0000 (15:22 -0700)
Summary: IndexedMemPool had one bare usage of std::atomic, rather than
the templated type Atom.  This doesn't affect any non-testing template
instantiations, because those two are usually synonyms, but it could cause
spurious failures of DeterministicSchedule tests.  Found via inspection,
not via failed tests.

Reviewed By: @yfeldblum

Differential Revision: D2277424

folly/IndexedMemPool.h

index e1b7e43efc38d28f0417f2db5a0fd2323e319cb1..437685a23e657349cee5dd9c8e2ce51376242299 100644 (file)
@@ -306,7 +306,7 @@ struct IndexedMemPool : boost::noncopyable {
   /// To allow use of atomic ++ instead of CAS, we let this overflow.
   /// The actual number of constructed elements is min(actualCapacity_,
   /// size_)
   /// To allow use of atomic ++ instead of CAS, we let this overflow.
   /// The actual number of constructed elements is min(actualCapacity_,
   /// size_)
-  std::atomic<uint32_t> size_;
+  Atom<uint32_t> size_;
 
   /// raw storage, only 1..min(size_,actualCapacity_) (inclusive) are
   /// actually constructed.  Note that slots_[0] is not constructed or used
 
   /// raw storage, only 1..min(size_,actualCapacity_) (inclusive) are
   /// actually constructed.  Note that slots_[0] is not constructed or used