Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

SERVER-6759 - work around for libm loading on some platforms

  • Loading branch information...
commit 056704b124f2ba0525345658d3897f93981b267e 1 parent cbdd954
@erh erh authored
View
3  src/third_party/gperftools-2.0/src/sampler.cc
@@ -56,6 +56,8 @@ DEFINE_int64(tcmalloc_sample_parameter,
namespace tcmalloc {
+#if !defined(NO_TCMALLOC_SAMPLES) // 10gen
+
// Statics for Sampler
double Sampler::log_table_[1<<kFastlogNumBits];
@@ -126,5 +128,6 @@ size_t Sampler::PickNextSamplingPoint() {
return static_cast<size_t>(min(0.0, (FastLog2(q) - 26)) * (-log(2.0)
* FLAGS_tcmalloc_sample_parameter) + 1);
}
+#endif // !defined(NO_TCMALLOC_SAMPLES) // 10gen
} // namespace tcmalloc
View
22 src/third_party/gperftools-2.0/src/sampler.h
@@ -99,6 +99,27 @@ namespace tcmalloc {
// only result in a single call to PickNextSamplingPoint.
//-------------------------------------------------------------------
+#ifdef NO_TCMALLOC_SAMPLES // 10gen
+
+// Dummy class with same public interface as below
+class PERFTOOLS_DLL_DECL Sampler {
+ public:
+ void Init(uint32_t seed) {}
+ bool SampleAllocation(size_t k) { return false; }
+ static void InitStatics() {}
+ int GetSamplePeriod() { return 0; }
+
+# if 0
+ // "public" functions only used in the Sampler and tests of the Sampler
+ void Cleanup();
+ size_t PickNextSamplingPoint();
+ static uint64_t NextRandom(uint64_t rnd_);
+ static double FastLog2(const double & d);
+ static void PopulateFastLog2Table();
+# endif
+};
+
+#else
class PERFTOOLS_DLL_DECL Sampler {
public:
// Initialize this sampler.
@@ -173,6 +194,7 @@ inline double Sampler::FastLog2(const double & d) {
const int32_t exponent = ((x_high >> 20) & 0x7FF) - 1023;
return exponent + log_table_[y];
}
+#endif // NO_TCMALLOC_SAMPLES // 10gen
} // namespace tcmalloc
Please sign in to comment.
Something went wrong with that request. Please try again.