Removed deprecated function (#1506)

* Removed deprecated function

* updated tests too

* restore comment

Co-authored-by: dominic hamon <dominichamon@users.noreply.github.com>
This commit is contained in:
Vy Nguyen 2022-11-11 10:12:12 -05:00 committed by GitHub
parent d572f47773
commit 9714eb8d11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 14 deletions

View File

@ -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

View File

@ -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.

View File

@ -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;
}
};