summaryrefslogtreecommitdiff
path: root/compiler/optimizing/optimizing_compiler_stats.h
diff options
context:
space:
mode:
authorVladimir Marko <vmarko@google.com>2017-02-24 15:01:41 +0000
committerVladimir Marko <vmarko@google.com>2017-02-24 15:18:57 +0000
commitff754d19946de43bfd2fc04adcd430459cac1f16 (patch)
treed16b694f243e3e1dfb631594181c0ae6db48d592 /compiler/optimizing/optimizing_compiler_stats.h
parent438709f4f2454854f09a3b5c058834bbf772aaa8 (diff)
Fix initialization of OptimizingCompilerStats.
This is a follow-up to https://android-review.googlesource.com/343265 where we replaced Atomic<> with std::atomic<> because Atomic<> was hiding std::atomic<>::operator=(). However, while the default constructor of Atomic<> initializes the value, the default constructor of std::atomic<> does not. Test: m valgrind-test-art-host Bug: 34053922 Change-Id: Iff2b38a7b28ee2d114991b60e3c40a33425bfc48
Diffstat (limited to 'compiler/optimizing/optimizing_compiler_stats.h')
-rw-r--r--compiler/optimizing/optimizing_compiler_stats.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/optimizing/optimizing_compiler_stats.h b/compiler/optimizing/optimizing_compiler_stats.h
index f7f6a14e9d..7240d40d7f 100644
--- a/compiler/optimizing/optimizing_compiler_stats.h
+++ b/compiler/optimizing/optimizing_compiler_stats.h
@@ -73,7 +73,10 @@ enum MethodCompilationStat {
class OptimizingCompilerStats {
public:
- OptimizingCompilerStats() {}
+ OptimizingCompilerStats() {
+ // The std::atomic<> default constructor leaves values uninitialized, so initialize them now.
+ Reset();
+ }
void RecordStat(MethodCompilationStat stat, uint32_t count = 1) {
compile_stats_[stat] += count;