Add options to only backtrace specific sizes.
Add backtrace_size for only backtracing a single size.
Add backtrace_min_size to set the minimum value of size to backtrace.
Add backtrace_max_size to set the maximum value of size to backtrace.
Documented the new options.
Test: New unit test pass.
Change-Id: I1a773737910cd4bc2af9546547b3a2740bbcb22b
diff --git a/libc/malloc_debug/PointerData.h b/libc/malloc_debug/PointerData.h
index 97eec0a..3194bab 100644
--- a/libc/malloc_debug/PointerData.h
+++ b/libc/malloc_debug/PointerData.h
@@ -137,13 +137,13 @@
static void IteratePointers(std::function<void(uintptr_t pointer)> fn);
- static size_t AddBacktrace(size_t num_frames);
+ static size_t AddBacktrace(size_t num_frames, size_t size_bytes);
static void RemoveBacktrace(size_t hash_index);
static void Add(const void* pointer, size_t size);
static void Remove(const void* pointer);
- static void* AddFreed(const void* pointer);
+ static void* AddFreed(const void* pointer, size_t size_bytes);
static void LogFreeError(const FreePointerInfoType& info, size_t usable_size);
static void LogFreeBacktrace(const void* ptr);
static void VerifyFreedPointer(const FreePointerInfoType& info);