The point of Benchmark_accumulator
is to provide a global place where inline
benchmarking macros can register themselves. Once registered here, the benchmarks are
retrieved and analyzed using Core_bench
.
This module holds the registered benchmarks in a global hashtable indexed by library
name. We care about the registered benchmarks if and only if the library is being
used in a inline_benchmarks_runner.exe
. To avoid building this hashtable in cases
where we will not use it, this module peeks into the commandline args of the running
program to decide if the benchmarks should be registered or not.
add_benchmarks_flag
returns true if the benchmarks should be added to the
hashtable
add_bench
registers benchmarks with the global hashtable maintained in
pa_bench_lib
. This is meant to be called by the code generated for the BENCH and
BENCH_INDEXED macros
add_bench_module
adds a bench module name to the benchmarks. This is called by
BENCH_MODULE macro