summaryrefslogtreecommitdiff
path: root/libc/malloc_debug/PointerData.cpp
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2019-03-07 17:49:28 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2019-03-07 17:49:28 +0000
commitff16c0b89b7297bc70353f60afac9bb93d6b0087 (patch)
treeaa0802d01d19ed0891e6b77a732cc72ed5617dcc /libc/malloc_debug/PointerData.cpp
parent4e167f35d602f9dcede3b74ff3e09e88f3edb398 (diff)
parent6c619a0da3f96a26d91c1db48fd3e3be156aabe5 (diff)
Merge "Refactor the malloc_info code."
Diffstat (limited to 'libc/malloc_debug/PointerData.cpp')
-rw-r--r--libc/malloc_debug/PointerData.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/libc/malloc_debug/PointerData.cpp b/libc/malloc_debug/PointerData.cpp
index 6e9d24f56..5542c1e9f 100644
--- a/libc/malloc_debug/PointerData.cpp
+++ b/libc/malloc_debug/PointerData.cpp
@@ -492,6 +492,17 @@ void PointerData::LogLeaks() {
}
}
+void PointerData::GetAllocList(std::vector<ListInfoType>* list) {
+ std::lock_guard<std::mutex> pointer_guard(pointer_mutex_);
+ std::lock_guard<std::mutex> frame_guard(frame_mutex_);
+
+ if (pointers_.empty()) {
+ return;
+ }
+
+ GetList(list, false);
+}
+
void PointerData::GetInfo(uint8_t** info, size_t* overall_size, size_t* info_size,
size_t* total_memory, size_t* backtrace_size) {
std::lock_guard<std::mutex> pointer_guard(pointer_mutex_);