summaryrefslogtreecommitdiff
path: root/memory_replay/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'memory_replay/main.cpp')
-rw-r--r--memory_replay/main.cpp20
1 files changed, 3 insertions, 17 deletions
diff --git a/memory_replay/main.cpp b/memory_replay/main.cpp
index e610305e..9873ec70 100644
--- a/memory_replay/main.cpp
+++ b/memory_replay/main.cpp
@@ -37,7 +37,6 @@
constexpr size_t kDefaultMaxThreads = 512;
static size_t GetMaxAllocs(const AllocEntry* entries, size_t num_entries) {
- size_t max_allocs = 0;
size_t num_allocs = 0;
for (size_t i = 0; i < num_entries; i++) {
switch (entries[i].type) {
@@ -46,28 +45,15 @@ static size_t GetMaxAllocs(const AllocEntry* entries, size_t num_entries) {
case MALLOC:
case CALLOC:
case MEMALIGN:
- if (entries[i].ptr != 0) {
- num_allocs++;
- }
- break;
case REALLOC:
- if (entries[i].ptr == 0 && entries[i].u.old_ptr != 0) {
- num_allocs--;
- } else if (entries[i].ptr != 0 && entries[i].u.old_ptr == 0) {
- num_allocs++;
- }
+ num_allocs++;
break;
case FREE:
- if (entries[i].ptr != 0) {
- num_allocs--;
- }
+ num_allocs--;
break;
}
- if (num_allocs > max_allocs) {
- max_allocs = num_allocs;
- }
}
- return max_allocs;
+ return num_allocs;
}
static void ProcessDump(const AllocEntry* entries, size_t num_entries, size_t max_threads) {