1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
10 #include <memory_resource>
12 #include "benchmark/benchmark.h"
14 static void bm_list(benchmark::State
& state
) {
16 std::pmr::monotonic_buffer_resource
resource(buffer
, sizeof(buffer
));
17 for (auto _
: state
) {
18 std::pmr::list
<int> l(&resource
);
19 for (int64_t i
= 0; i
!= state
.range(); ++i
) {
21 benchmark::DoNotOptimize(l
);
26 BENCHMARK(bm_list
)->Range(1, 2048);