about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
authorMartinNowack <martin.nowack@gmail.com>2016-08-02 14:15:35 +0200
committerGitHub <noreply@github.com>2016-08-02 14:15:35 +0200
commit906cd594f28990113c5e7780564766befdcb93e1 (patch)
tree0bc4deb73b0c29a861f75d3772771e6d1577dc5c
parent21749dee2b14b56d4b2d0330046a9007552d577f (diff)
parent47cd9b3030b2cda212209dd9e282274d0d7547f0 (diff)
downloadklee-906cd594f28990113c5e7780564766befdcb93e1.tar.gz
Merge pull request #438 from jirislaby/memuse
MemoryUsage: handle ill-designed mallinfo
-rw-r--r--lib/Support/MemoryUsage.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Support/MemoryUsage.cpp b/lib/Support/MemoryUsage.cpp
index a9f4026d..d141593a 100644
--- a/lib/Support/MemoryUsage.cpp
+++ b/lib/Support/MemoryUsage.cpp
@@ -26,7 +26,7 @@ using namespace klee;
 
 size_t util::GetTotalMallocUsage() {
 #ifdef HAVE_GPERFTOOLS_MALLOC_EXTENSION_H
-  uint64_t value;
+  size_t value = 0;
   MallocExtension::instance()->GetNumericProperty(
       "generic.current_allocated_bytes", &value);
   return value;
@@ -36,9 +36,9 @@ size_t util::GetTotalMallocUsage() {
   // does not include mmap()'ed memory in mi.uordblks
   // but other implementations (e.g. tcmalloc) do.
 #if defined(__GLIBC__)
-  return mi.uordblks + mi.hblkhd;
+  return (size_t)(unsigned)mi.uordblks + (unsigned)mi.hblkhd;
 #else
-  return mi.uordblks;
+  return (unsigned)mi.uordblks;
 #endif
 
 #elif defined(HAVE_MALLOC_ZONE_STATISTICS) && defined(HAVE_MALLOC_MALLOC_H)