summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Treehugger Robot <treehugger-gerrit@google.com> 2017-04-18 11:29:25 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2017-04-18 11:29:26 +0000
commit4cb99a13d21443a028a8e8a54261e215ca4b5a74 (patch)
treea6d1400ac5c32b0bdb7d53337c04cc9d736d2d4c
parent36831abc29f76baee9a7673a2c18465f33df3f05 (diff)
parentd38ba0a3abd7f6140f0851d826449afec5689d57 (diff)
Merge "Fix Arena allocation tracking."
-rw-r--r--runtime/base/arena_allocator.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/runtime/base/arena_allocator.cc b/runtime/base/arena_allocator.cc
index e763e439b9..935fd81115 100644
--- a/runtime/base/arena_allocator.cc
+++ b/runtime/base/arena_allocator.cc
@@ -78,6 +78,7 @@ const char* const ArenaAllocatorStatsImpl<kCount>::kAllocNames[] = {
"RegAllocator ",
"RegAllocVldt ",
"StackMapStm ",
+ "VectorNode ",
"CodeGen ",
"Assembler ",
"ParallelMove ",
@@ -150,8 +151,15 @@ void ArenaAllocatorStatsImpl<kCount>::Dump(std::ostream& os, const Arena* first,
#if __clang_major__ >= 4
#pragma GCC diagnostic ignored "-Winstantiation-after-specialization"
#endif
-// Explicitly instantiate the used implementation.
-template class ArenaAllocatorStatsImpl<kArenaAllocatorCountAllocations>;
+// We're going to use ArenaAllocatorStatsImpl<kArenaAllocatorCountAllocations> which needs
+// to be explicitly instantiated if kArenaAllocatorCountAllocations is true. Explicit
+// instantiation of the specialization ArenaAllocatorStatsImpl<false> does not do anything
+// but requires the warning "-Winstantiation-after-specialization" to be turned off.
+//
+// To avoid bit-rot of the ArenaAllocatorStatsImpl<true>, instantiate it also in debug builds
+// (but keep the unnecessary code out of release builds) as we do not usually compile with
+// kArenaAllocatorCountAllocations set to true.
+template class ArenaAllocatorStatsImpl<kArenaAllocatorCountAllocations || kIsDebugBuild>;
#pragma GCC diagnostic pop
void ArenaAllocatorMemoryTool::DoMakeDefined(void* ptr, size_t size) {