Skip to content

Commit d80e779

Browse files
committed
Benchmarks: switch RegisterBenchmarkInternal to std::unique_ptr
Adapting to new google benchmark requirements of >= v1.9.2. See google/benchmark#1927
1 parent f84f72e commit d80e779

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ Once installed, you can use `pkg-config --cflags --libs x86simdsortcpp` to
7878
populate the right cflags and ldflags to compile and link your C++ program.
7979
This repository also contains a test suite and benchmarking suite which are
8080
written using [googletest](https://github.com/google/googletest) and [google
81-
benchmark](https://github.com/google/benchmark) frameworks respectively. You
82-
can configure meson to build them both by using `-Dbuild_tests=true` and
83-
`-Dbuild_benchmarks=true`.
81+
benchmark](https://github.com/google/benchmark) (>= v1.9.2) frameworks
82+
respectively. You can configure meson to build them both by using
83+
`-Dbuild_tests=true` and `-Dbuild_benchmarks=true`.
8484

8585
## Build using OpenMP
8686

benchmarks/bench.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
#define MY_BENCHMARK_CAPTURE(func, T, test_case_name, ...) \
66
BENCHMARK_PRIVATE_DECLARE(func) \
77
= (::benchmark::internal::RegisterBenchmarkInternal( \
8+
std::unique_ptr<benchmark::internal::Benchmark>( \
89
new ::benchmark::internal::FunctionBenchmark( \
910
#func "/" #test_case_name "/" #T, \
1011
[](::benchmark::State &st) { \
1112
func<T>(st, __VA_ARGS__); \
12-
})))
13+
}))))
1314

1415
#define BENCH_SORT(func, type) \
1516
MY_BENCHMARK_CAPTURE(func, type, random_128, 128, std::string("random")); \

0 commit comments

Comments
 (0)