diff options
| author | Christopher Ferris <cferris@google.com> | 2019-05-02 18:33:11 -0700 |
|---|---|---|
| committer | Christopher Ferris <cferris@google.com> | 2019-05-03 07:21:45 -0700 |
| commit | db9706afc376f74938e4060fa030913e87bb2be1 (patch) | |
| tree | 22e9605dd1edde31191b9ed8e2a39907deca56f0 /libc/bionic/jemalloc_wrapper.cpp | |
| parent | 1eb6d36ba8666dace9a6f0c1db354750b331bf24 (diff) | |
Fix malloc_info missing large allocs.
Also change the names of some of the functions to make it very obvious
that the functions being called are in je code.
Write new test to make sure mallinfo and malloc_info match.
Bug: 131864803
Test: New unit tests pass (along with all other bionic unit tests).
Change-Id: I26eda7e64f57a8c56cc8d70e3ed6a29dcb87f630
Merged-In: I26eda7e64f57a8c56cc8d70e3ed6a29dcb87f630
(cherry picked from commit 125d32cb469d8e31f656543c3ad7b82154bc1689)
Diffstat (limited to 'libc/bionic/jemalloc_wrapper.cpp')
| -rw-r--r-- | libc/bionic/jemalloc_wrapper.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libc/bionic/jemalloc_wrapper.cpp b/libc/bionic/jemalloc_wrapper.cpp index fd99814a6..bf0494dde 100644 --- a/libc/bionic/jemalloc_wrapper.cpp +++ b/libc/bionic/jemalloc_wrapper.cpp @@ -128,10 +128,10 @@ int je_mallopt(int param, int value) { __BEGIN_DECLS -size_t __mallinfo_narenas(); -size_t __mallinfo_nbins(); -struct mallinfo __mallinfo_arena_info(size_t); -struct mallinfo __mallinfo_bin_info(size_t, size_t); +size_t je_mallinfo_narenas(); +size_t je_mallinfo_nbins(); +struct mallinfo je_mallinfo_arena_info(size_t); +struct mallinfo je_mallinfo_bin_info(size_t, size_t); __END_DECLS @@ -144,8 +144,8 @@ int je_malloc_info(int options, FILE* fp) { MallocXmlElem root(fp, "malloc", "version=\"jemalloc-1\""); // Dump all of the large allocations in the arenas. - for (size_t i = 0; i < __mallinfo_narenas(); i++) { - struct mallinfo mi = __mallinfo_arena_info(i); + for (size_t i = 0; i < je_mallinfo_narenas(); i++) { + struct mallinfo mi = je_mallinfo_arena_info(i); if (mi.hblkhd != 0) { MallocXmlElem arena_elem(fp, "heap", "nr=\"%d\"", i); { @@ -154,8 +154,8 @@ int je_malloc_info(int options, FILE* fp) { MallocXmlElem(fp, "allocated-bins").Contents("%zu", mi.fsmblks); size_t total = 0; - for (size_t j = 0; j < __mallinfo_nbins(); j++) { - struct mallinfo mi = __mallinfo_bin_info(i, j); + for (size_t j = 0; j < je_mallinfo_nbins(); j++) { + struct mallinfo mi = je_mallinfo_bin_info(i, j); if (mi.ordblks != 0) { MallocXmlElem bin_elem(fp, "bin", "nr=\"%d\"", j); MallocXmlElem(fp, "allocated").Contents("%zu", mi.ordblks); |
