Commit ed8df706 authored by Orvid King's avatar Orvid King Committed by facebook-github-bot-1

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