From: Peter Griess Date: Mon, 23 Sep 2013 21:44:57 +0000 (-0500) Subject: Disable memory reporting for non-GNU C++ libraries. X-Git-Tag: v0.22.0~842 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d53c9e56b261b1dcc560c1bbd835db9883b986e3;p=folly.git 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 --- 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);