Make some types and constexprs public
authorOrvid King <blah38621@gmail.com>
Tue, 4 Aug 2015 23:01:48 +0000 (16:01 -0700)
committerfacebook-github-bot-1 <folly-bot@fb.com>
Wed, 5 Aug 2015 00:22:20 +0000 (17:22 -0700)
Summary: MSVC has some odd accessibility rules,
so this makes a couple of things public rather than private.
Closes #284

Reviewed By: @yfeldblum

Differential Revision: D2307578

Pulled By: @sgolemon

folly/SharedMutex.h
folly/stats/Histogram.h

index 196df92860dcec283d592f942f8909deeb96ca54..05f317b26d4b767d85996b70770b6b2194738fe7 100644 (file)
@@ -676,10 +676,13 @@ class SharedMutexImpl {
   // guarantees we won't have inter-L1 contention.  We give ourselves
   // a factor of 2 on the core count, which should hold us for a couple
   // processor generations.  deferredReaders[] is 2048 bytes currently.
   // guarantees we won't have inter-L1 contention.  We give ourselves
   // a factor of 2 on the core count, which should hold us for a couple
   // processor generations.  deferredReaders[] is 2048 bytes currently.
+ public:
   static constexpr uint32_t kMaxDeferredReaders = 64;
   static constexpr uint32_t kDeferredSearchDistance = 2;
   static constexpr uint32_t kDeferredSeparationFactor = 4;
 
   static constexpr uint32_t kMaxDeferredReaders = 64;
   static constexpr uint32_t kDeferredSearchDistance = 2;
   static constexpr uint32_t kDeferredSeparationFactor = 4;
 
+ private:
+
   static_assert(!(kMaxDeferredReaders & (kMaxDeferredReaders - 1)),
                 "kMaxDeferredReaders must be a power of 2");
   static_assert(!(kDeferredSearchDistance & (kDeferredSearchDistance - 1)),
   static_assert(!(kMaxDeferredReaders & (kMaxDeferredReaders - 1)),
                 "kMaxDeferredReaders must be a power of 2");
   static_assert(!(kDeferredSearchDistance & (kDeferredSearchDistance - 1)),
@@ -710,7 +713,10 @@ class SharedMutexImpl {
   // If any of those elements points to a SharedMutexImpl, then it
   // should be considered that there is a shared lock on that instance.
   // See kTokenless.
   // If any of those elements points to a SharedMutexImpl, then it
   // should be considered that there is a shared lock on that instance.
   // See kTokenless.
+ public:
   typedef Atom<uintptr_t> DeferredReaderSlot;
   typedef Atom<uintptr_t> DeferredReaderSlot;
+
+ private:
   FOLLY_ALIGN_TO_AVOID_FALSE_SHARING static DeferredReaderSlot deferredReaders
       [kMaxDeferredReaders *
        kDeferredSeparationFactor];
   FOLLY_ALIGN_TO_AVOID_FALSE_SHARING static DeferredReaderSlot deferredReaders
       [kMaxDeferredReaders *
        kDeferredSeparationFactor];
index c3bdf96db5f77d5c723a32f82c41fc4f46a2855f..7b7ee1ed3afcc662e7f1dcb53c97f2759d7722e0 100644 (file)
@@ -438,7 +438,6 @@ class Histogram {
    */
   void toTSV(std::ostream& out, bool skipEmptyBuckets = true) const;
 
    */
   void toTSV(std::ostream& out, bool skipEmptyBuckets = true) const;
 
- private:
   struct CountFromBucket {
     uint64_t operator()(const Bucket& bucket) const {
       return bucket.count;
   struct CountFromBucket {
     uint64_t operator()(const Bucket& bucket) const {
       return bucket.count;
@@ -462,6 +461,7 @@ class Histogram {
     }
   };
 
     }
   };
 
+ private:
   detail::HistogramBuckets<ValueType, Bucket> buckets_;
 };
 
   detail::HistogramBuckets<ValueType, Bucket> buckets_;
 };