From 9714eb8d118ff75da1f887f41645f7c4fab3e58f Mon Sep 17 00:00:00 2001 From: Vy Nguyen Date: Fri, 11 Nov 2022 10:12:12 -0500 Subject: [PATCH] Removed deprecated function (#1506) * Removed deprecated function * updated tests too * restore comment Co-authored-by: dominic hamon --- include/benchmark/benchmark.h | 8 +------- src/benchmark_runner.cc | 5 +---- test/memory_manager_test.cc | 6 +++--- 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/include/benchmark/benchmark.h b/include/benchmark/benchmark.h index fefe9b20e5..54d4e3cf0c 100644 --- a/include/benchmark/benchmark.h +++ b/include/benchmark/benchmark.h @@ -383,13 +383,7 @@ class MemoryManager { virtual void Start() = 0; // Implement this to stop recording and fill out the given Result structure. - BENCHMARK_DEPRECATED_MSG("Use Stop(Result&) instead") - virtual void Stop(Result* result) = 0; - - // FIXME(vyng): Make this pure virtual once we've migrated current users. - BENCHMARK_DISABLE_DEPRECATED_WARNING - virtual void Stop(Result& result) { Stop(&result); } - BENCHMARK_RESTORE_DEPRECATED_WARNING + virtual void Stop(Result& result) = 0; }; // Register a MemoryManager instance that will be used to collect and report diff --git a/src/benchmark_runner.cc b/src/benchmark_runner.cc index fd6da53ffd..04e5c2a758 100644 --- a/src/benchmark_runner.cc +++ b/src/benchmark_runner.cc @@ -387,10 +387,7 @@ void BenchmarkRunner::DoOneRepetition() { manager->WaitForAllThreads(); manager.reset(); b.Teardown(); - - BENCHMARK_DISABLE_DEPRECATED_WARNING - memory_manager->Stop(memory_result); - BENCHMARK_RESTORE_DEPRECATED_WARNING + memory_manager->Stop(*memory_result); } // Ok, now actually report. diff --git a/test/memory_manager_test.cc b/test/memory_manager_test.cc index f0c192fcbd..4b08f3f77b 100644 --- a/test/memory_manager_test.cc +++ b/test/memory_manager_test.cc @@ -6,9 +6,9 @@ class TestMemoryManager : public benchmark::MemoryManager { void Start() BENCHMARK_OVERRIDE {} - void Stop(Result* result) BENCHMARK_OVERRIDE { - result->num_allocs = 42; - result->max_bytes_used = 42000; + void Stop(Result& result) BENCHMARK_OVERRIDE { + result.num_allocs = 42; + result.max_bytes_used = 42000; } };