klee
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MemoryUsage.cpp
Go to the documentation of this file.
1 //===-- MemoryUsage.cpp ---------------------------------------------------===//
2 //
3 // The KLEE Symbolic Virtual Machine
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
11 #include <malloc.h>
12 
13 using namespace klee;
14 
16  struct mallinfo mi = ::mallinfo();
17  // The malloc implementation in glibc (pmalloc2)
18  // does not include mmap()'ed memory in mi.uordblks
19  // but other implementations (e.g. tcmalloc) do.
20 #if defined(__GLIBC__)
21  return mi.uordblks + mi.hblkhd;
22 #else
23  return mi.uordblks;
24 #endif
25 }
size_t GetTotalMallocUsage()
Definition: MemoryUsage.cpp:15