diff options
author | Martijn Coenen <maco@google.com> | 2016-11-14 14:16:08 +0100 |
---|---|---|
committer | Martijn Coenen <maco@google.com> | 2016-11-15 09:07:11 +0100 |
commit | be763d85c881b58754e650192204e8a2309660cb (patch) | |
tree | 09175cceb1d28d140993c687b4c89abfeac2763d /benchmarks/string_benchmark.cpp | |
parent | b3321c961452f69650e4a6bd2a7db317a80b3234 (diff) |
Fix deprecated range_x() calls.
Test: builds with new libbenchmark.
Change-Id: I91c0e5c1b5cf75b8e551f3c59d83ac9352817c4a
Diffstat (limited to 'benchmarks/string_benchmark.cpp')
-rw-r--r-- | benchmarks/string_benchmark.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/benchmarks/string_benchmark.cpp b/benchmarks/string_benchmark.cpp index 0a3851265..41306db1c 100644 --- a/benchmarks/string_benchmark.cpp +++ b/benchmarks/string_benchmark.cpp @@ -27,7 +27,7 @@ constexpr auto KB = 1024; // TODO: test unaligned operation too? (currently everything will be 8-byte aligned by malloc.) static void BM_string_memcmp(benchmark::State& state) { - const size_t nbytes = state.range_x(); + const size_t nbytes = state.range(0); char* src = new char[nbytes]; char* dst = new char[nbytes]; memset(src, 'x', nbytes); memset(dst, 'x', nbytes); @@ -44,7 +44,7 @@ static void BM_string_memcmp(benchmark::State& state) { BENCHMARK(BM_string_memcmp)->AT_COMMON_SIZES; static void BM_string_memcpy(benchmark::State& state) { - const size_t nbytes = state.range_x(); + const size_t nbytes = state.range(0); char* src = new char[nbytes]; char* dst = new char[nbytes]; memset(src, 'x', nbytes); @@ -59,7 +59,7 @@ static void BM_string_memcpy(benchmark::State& state) { BENCHMARK(BM_string_memcpy)->AT_COMMON_SIZES; static void BM_string_memmove(benchmark::State& state) { - const size_t nbytes = state.range_x(); + const size_t nbytes = state.range(0); char* buf = new char[nbytes + 64]; memset(buf, 'x', nbytes + 64); @@ -73,7 +73,7 @@ static void BM_string_memmove(benchmark::State& state) { BENCHMARK(BM_string_memmove)->AT_COMMON_SIZES; static void BM_string_memset(benchmark::State& state) { - const size_t nbytes = state.range_x(); + const size_t nbytes = state.range(0); char* dst = new char[nbytes]; while (state.KeepRunning()) { @@ -86,7 +86,7 @@ static void BM_string_memset(benchmark::State& state) { BENCHMARK(BM_string_memset)->AT_COMMON_SIZES; static void BM_string_strlen(benchmark::State& state) { - const size_t nbytes = state.range_x(); + const size_t nbytes = state.range(0); char* s = new char[nbytes]; memset(s, 'x', nbytes); s[nbytes - 1] = 0; |