aboutsummaryrefslogtreecommitdiff
path: root/include/benchmark
diff options
context:
space:
mode:
authorChris Kennelly <ckennelly@ckennelly.com>2014-04-23 01:17:47 -0700
committerChris Kennelly <ckennelly@ckennelly.com>2014-04-23 01:17:47 -0700
commit9f27edbb1650c297f511c4b52e563ee3f0619348 (patch)
treeb660b772ed69bef451730474f9aaaa8defa0eea7 /include/benchmark
parentfa908926c7ab9270037e2ab71036f8f6f87e9850 (diff)
downloadgoogle-benchmark-9f27edbb1650c297f511c4b52e563ee3f0619348.tar.gz
Resolve memory leak from benchmark instances in google/benchmark#17.
This shifts registration from a global vector to a singleton that manages benchmark destruction during shutdown.
Diffstat (limited to 'include/benchmark')
-rw-r--r--include/benchmark/benchmark.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/include/benchmark/benchmark.h b/include/benchmark/benchmark.h
index 977e646..e7ec531 100644
--- a/include/benchmark/benchmark.h
+++ b/include/benchmark/benchmark.h
@@ -178,6 +178,7 @@ void UseRealTime();
namespace internal {
class Benchmark;
+class BenchmarkFamilies;
}
// State is passed to a running Benchmark and contains state for the
@@ -444,15 +445,12 @@ class Benchmark {
// Used inside the benchmark implementation
struct Instance;
- // Extract the list of benchmark instances that match the specified
- // regular expression.
- static void FindBenchmarks(const std::string& re,
- std::vector<Instance>* benchmarks);
-
// Measure the overhead of an empty benchmark to subtract later.
static void MeasureOverhead();
private:
+ friend class BenchmarkFamilies;
+
std::vector<Benchmark::Instance> CreateBenchmarkInstances(int rangeXindex,
int rangeYindex);