From: Orvid King Date: Tue, 4 Aug 2015 23:01:48 +0000 (-0700) Subject: Make some types and constexprs public X-Git-Tag: v0.53.0~8 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=ed8df706e3cf44aa4b45cd104b7c2e3c4eb74512;p=folly.git Make some types and constexprs public 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 --- diff --git a/folly/SharedMutex.h b/folly/SharedMutex.h index 196df928..05f317b2 100644 --- a/folly/SharedMutex.h +++ b/folly/SharedMutex.h @@ -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. + public: 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)), @@ -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. + public: typedef Atom DeferredReaderSlot; + + private: FOLLY_ALIGN_TO_AVOID_FALSE_SHARING static DeferredReaderSlot deferredReaders [kMaxDeferredReaders * kDeferredSeparationFactor]; diff --git a/folly/stats/Histogram.h b/folly/stats/Histogram.h index c3bdf96d..7b7ee1ed 100644 --- a/folly/stats/Histogram.h +++ b/folly/stats/Histogram.h @@ -438,7 +438,6 @@ class Histogram { */ void toTSV(std::ostream& out, bool skipEmptyBuckets = true) const; - private: struct CountFromBucket { uint64_t operator()(const Bucket& bucket) const { return bucket.count; @@ -462,6 +461,7 @@ class Histogram { } }; + private: detail::HistogramBuckets buckets_; };