From d53c9e56b261b1dcc560c1bbd835db9883b986e3 Mon Sep 17 00:00:00 2001 From: Peter Griess Date: Mon, 23 Sep 2013 16:44:57 -0500 Subject: [PATCH] Disable memory reporting for non-GNU C++ libraries. Summary: - Non-GNU standard C++ libraries may have a different layout; only report memory usage when we know we're using GNU's. Test Plan: - fbconfig -r folly && fbmake runtests - ./configure && make check on Ubuntu/FC/Mac Reviewed By: andrei.alexandrescu@fb.com FB internal diff: D998584 --- folly/test/ConcurrentSkipListBenchmark.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/folly/test/ConcurrentSkipListBenchmark.cpp b/folly/test/ConcurrentSkipListBenchmark.cpp index 0eac9be1..c05bda73 100644 --- a/folly/test/ConcurrentSkipListBenchmark.cpp +++ b/folly/test/ConcurrentSkipListBenchmark.cpp @@ -350,6 +350,9 @@ class ConcurrentAccessData { if (i > 0) sets_[i] = sets_[0]; } +// This requires knowledge of the C++ library internals. Only use it if we're +// using the GNU C++ library. +#ifdef _GLIBCXX_SYMVER // memory usage int64_t setMemorySize = sets_[0].size() * sizeof(*sets_[0].begin()._M_node); int64_t cslMemorySize = 0; @@ -360,6 +363,7 @@ class ConcurrentAccessData { LOG(INFO) << "size=" << sets_[0].size() << "; std::set memory size=" << setMemorySize << "; csl memory size=" << cslMemorySize; +#endif readValues_.reserve(size); deleteValues_.reserve(size); -- 2.34.1