about summary refs log tree commit diff homepage
path: root/lib/Support
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Support')
-rw-r--r--lib/Support/MemoryUsage.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/Support/MemoryUsage.cpp b/lib/Support/MemoryUsage.cpp
new file mode 100644
index 00000000..1bdff819
--- /dev/null
+++ b/lib/Support/MemoryUsage.cpp
@@ -0,0 +1,19 @@
+//===-- MemoryUsage.cpp ---------------------------------------------------===//
+//
+//                     The KLEE Symbolic Virtual Machine
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "klee/Internal/System/MemoryUsage.h"
+#include <malloc.h>
+
+using namespace klee;
+
+size_t util::GetTotalMemoryUsage() {
+  // This is linux platform specific
+  struct mallinfo mi = ::mallinfo();
+  return mi.uordblks + mi.hblkhd;
+}