From 4444e21e7926ca079583f14a51cca0bf5e01b711 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Fri, 12 Sep 2014 13:45:46 -0700 Subject: Do not require mallinfo(), which is Linux specific. --- lib/Support/MemoryUsage.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lib') diff --git a/lib/Support/MemoryUsage.cpp b/lib/Support/MemoryUsage.cpp index 676ce307..6143b127 100644 --- a/lib/Support/MemoryUsage.cpp +++ b/lib/Support/MemoryUsage.cpp @@ -8,11 +8,17 @@ //===----------------------------------------------------------------------===// #include "klee/Internal/System/MemoryUsage.h" + +#include "klee/Config/config.h" + +#ifdef HAVE_MALLINFO #include +#endif using namespace klee; size_t util::GetTotalMallocUsage() { +#ifdef HAVE_MALLINFO struct mallinfo mi = ::mallinfo(); // The malloc implementation in glibc (pmalloc2) // does not include mmap()'ed memory in mi.uordblks @@ -22,4 +28,11 @@ size_t util::GetTotalMallocUsage() { #else return mi.uordblks; #endif + +#else // HAVE_MALLINFO + +#warning Cannot get malloc info on this platform + return 0; + +#endif } -- cgit 1.4.1