mirror of
https://github.com/google/benchmark.git
synced 2025-01-30 22:00:16 +08:00
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:
parent
d572f47773
commit
9714eb8d11
@ -383,13 +383,7 @@ class MemoryManager {
|
|||||||
virtual void Start() = 0;
|
virtual void Start() = 0;
|
||||||
|
|
||||||
// Implement this to stop recording and fill out the given Result structure.
|
// 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;
|
||||||
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
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Register a MemoryManager instance that will be used to collect and report
|
// Register a MemoryManager instance that will be used to collect and report
|
||||||
|
@ -387,10 +387,7 @@ void BenchmarkRunner::DoOneRepetition() {
|
|||||||
manager->WaitForAllThreads();
|
manager->WaitForAllThreads();
|
||||||
manager.reset();
|
manager.reset();
|
||||||
b.Teardown();
|
b.Teardown();
|
||||||
|
memory_manager->Stop(*memory_result);
|
||||||
BENCHMARK_DISABLE_DEPRECATED_WARNING
|
|
||||||
memory_manager->Stop(memory_result);
|
|
||||||
BENCHMARK_RESTORE_DEPRECATED_WARNING
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ok, now actually report.
|
// Ok, now actually report.
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
|
|
||||||
class TestMemoryManager : public benchmark::MemoryManager {
|
class TestMemoryManager : public benchmark::MemoryManager {
|
||||||
void Start() BENCHMARK_OVERRIDE {}
|
void Start() BENCHMARK_OVERRIDE {}
|
||||||
void Stop(Result* result) BENCHMARK_OVERRIDE {
|
void Stop(Result& result) BENCHMARK_OVERRIDE {
|
||||||
result->num_allocs = 42;
|
result.num_allocs = 42;
|
||||||
result->max_bytes_used = 42000;
|
result.max_bytes_used = 42000;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user