Skip to content

Commit

Permalink
Removed deprecated function (#1506)
Browse files Browse the repository at this point in the history
* Removed deprecated function

* updated tests too

* restore comment

Co-authored-by: dominic hamon <dominichamon@users.noreply.github.com>
  • Loading branch information
oontvoo and dominichamon committed Nov 11, 2022
1 parent d572f47 commit 9714eb8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
8 changes: 1 addition & 7 deletions include/benchmark/benchmark.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 1 addition & 4 deletions src/benchmark_runner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions test/memory_manager_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
};

Expand Down

0 comments on commit 9714eb8

Please sign in to comment.