15 void *synth_base =
reinterpret_cast<void *
>(0x08000000);
16 const size_t synth_size = 1024 * 1024;
17 Arena b(synth_base, synth_size, 16);
19 std::vector<void *> addr;
20 for (
int x = 0; x <
ASIZE; ++x) {
21 addr.push_back(
nullptr);
23 uint32_t s = 0x12345678;
25 int idx = s & (addr.size() - 1);
29 }
else if (!addr[idx]) {
39 for (
void *ptr : addr) {
BENCHMARK(BenchLockedPool)
static void BenchLockedPool(benchmark::Bench &bench)
An arena manages a contiguous region of memory by dividing it into chunks.
void * alloc(size_t size)
Allocate size bytes from this arena.
void free(void *ptr)
Free a previously allocated chunk of memory.
Main entry point to nanobench's benchmarking facility.
Bench & run(char const *benchmarkName, Op &&op)
Repeatedly calls op() based on the configuration, and performs measurements.