Skip to content

Commit 26b376b

Browse files
committed
fix(benchmark): delete unneccessary, confusing code in loop
p.diags() is uninteresting inside the benchmark loop as p isn't touched in the loop. Rather, diags is the relevant variable. However, diags and its allocator (memory) are created and destroyed inside the benchmark loop, so explicit clearing (diags.clear()) is unnecessary Delete the clearing of p.diags().
1 parent d0b6a6b commit 26b376b

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

benchmark/benchmark-lint.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@ void benchmark_lint(benchmark::State &state) {
4646
Diag_List diags(&memory);
4747
Variable_Analyzer l(&diags, &config.globals(), var_options);
4848
visitor.copy_into(l);
49-
50-
// FIXME(strager): This does not deallocate memory. Memory usage will grow
51-
// and grow and grow.
52-
p.diags().clear();
5349
}
5450
}
5551
BENCHMARK(benchmark_lint);

0 commit comments

Comments
 (0)