summaryrefslogtreecommitdiff
path: root/libc/malloc_debug/PointerData.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libc/malloc_debug/PointerData.cpp')
-rw-r--r--libc/malloc_debug/PointerData.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/libc/malloc_debug/PointerData.cpp b/libc/malloc_debug/PointerData.cpp
index b982c0ae8..0afad30e3 100644
--- a/libc/malloc_debug/PointerData.cpp
+++ b/libc/malloc_debug/PointerData.cpp
@@ -198,7 +198,10 @@ void PointerData::Add(const void* ptr, size_t pointer_size) {
uintptr_t pointer = reinterpret_cast<uintptr_t>(ptr);
size_t hash_index = 0;
if (backtrace_enabled_) {
- hash_index = AddBacktrace(g_debug->config().backtrace_frames());
+ if ((pointer_size >= g_min_alloc_to_record) &&
+ (pointer_size <= g_max_alloc_to_record)) {
+ hash_index = AddBacktrace(g_debug->config().backtrace_frames());
+ }
}
std::lock_guard<std::mutex> pointer_guard(pointer_mutex_);