From 022d4ec34aa7b50e89bf1840100e914ec4d09785 Mon Sep 17 00:00:00 2001 From: Jeremy Leconte Date: Fri, 17 Mar 2023 14:30:41 +0100 Subject: [PATCH] Fix 'DoNotOptimize' is deprecated issue. Change-Id: Ia25b7f73882d45bd2f1a606f51569269ece25fe0 Bug: None Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/298042 Reviewed-by: Mirko Bonadei Commit-Queue: Jeremy Leconte Cr-Commit-Position: refs/heads/main@{#39589} --- rtc_base/synchronization/mutex_benchmark.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rtc_base/synchronization/mutex_benchmark.cc b/rtc_base/synchronization/mutex_benchmark.cc index 40adca65d8..ae0e3c38e7 100644 --- a/rtc_base/synchronization/mutex_benchmark.cc +++ b/rtc_base/synchronization/mutex_benchmark.cc @@ -38,7 +38,8 @@ void BM_LockWithMutex(benchmark::State& state) { static PerfTestData test_data; for (auto s : state) { RTC_UNUSED(s); - benchmark::DoNotOptimize(test_data.AddToCounter(2)); + int add_to_counter = test_data.AddToCounter(2); + benchmark::DoNotOptimize(add_to_counter); } }