@@ -5,25 +5,25 @@ reworking the patch and tests to be suitable.
5
5
6
6
--- src/console_reporter.cc
7
7
+++ src/console_reporter.cc
8
- @@ -53,9 +53,11 @@ bool ConsoleReporter::ReportContext(const Context& context) {
9
- }
8
+ @@ -59,9 +59,11 @@ bool ConsoleReporter::ReportContext(const Context& context) {
10
9
10
+ BENCHMARK_EXPORT
11
11
void ConsoleReporter::PrintHeader(const Run& run) {
12
- + const bool show_allocs = (run.memory_result != nullptr );
12
+ + const bool show_allocs = (run.memory_result.memory_iterations > 0 );
13
13
std::string str =
14
14
- FormatString("%-*s %13s %15s %12s", static_cast<int>(name_field_width_),
15
15
- "Benchmark", "Time", "CPU", "Iterations");
16
16
+ FormatString("%-*s %13s %15s %*s%12s", static_cast<int>(name_field_width_),
17
17
+ "Benchmark", "Time", "CPU", show_allocs ? 10 : 0,
18
18
+ show_allocs ? "Allocs " : "", "Iterations");
19
19
if (!run.counters.empty()) {
20
- if (output_options_ & OO_Tabular) {
20
+ if (( output_options_ & OO_Tabular) != 0 ) {
21
21
for (auto const& c : run.counters) {
22
- @@ -163 ,6 +165 ,11 @@ void ConsoleReporter::PrintRunData(const Run& result) {
22
+ @@ -176 ,6 +178 ,11 @@ void ConsoleReporter::PrintRunData(const Run& result) {
23
23
}
24
24
25
25
if (!result.report_big_o && !result.report_rms) {
26
- + const bool show_allocs = (result.memory_result != nullptr );
26
+ + const bool show_allocs = (result.memory_result.memory_iterations > 0 );
27
27
+ if (show_allocs) {
28
28
+ const std::string s = HumanReadableNumber(result.allocs_per_iter, Counter::kIs1000);
29
29
+ printer(Out, COLOR_YELLOW, "%7s ", s.c_str());
0 commit comments