[LLVMbugs] [Bug 20925] New: Process::GetMallocUsage() may be wrong for non-glibc

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Sep 12 13:21:34 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=20925

            Bug ID: 20925
           Summary: Process::GetMallocUsage() may be wrong for non-glibc
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Support Libraries
          Assignee: unassignedbugs at nondot.org
          Reporter: daniel at zuster.org
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

The KLEE code has this comment around its function to get memory usage:
--
   struct mallinfo mi = ::mallinfo();
+  // The malloc implementation in glibc (pmalloc2)
+  // does not include mmap()'ed memory in mi.uordblks
+  // but other implementations (e.g. tcmalloc) do.
+#if defined(__GLIBC__)
   return mi.uordblks + mi.hblkhd;
+#else
+  return mi.uordblks;
+#endif
--

but LLVM's Process::GetMallocUsage() does not have that logic. Someone should
check this...

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140912/e5c55a0a/attachment.html>


More information about the llvm-bugs mailing list