diff options
Diffstat (limited to 'compiler/utils/arena_allocator.cc')
-rw-r--r-- | compiler/utils/arena_allocator.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/utils/arena_allocator.cc b/compiler/utils/arena_allocator.cc index 365b094e95..ca4635d352 100644 --- a/compiler/utils/arena_allocator.cc +++ b/compiler/utils/arena_allocator.cc @@ -31,7 +31,8 @@ static constexpr bool kUseMemSet = true && kUseMemMap; static constexpr size_t kValgrindRedZoneBytes = 8; constexpr size_t Arena::kDefaultSize; -static const char* alloc_names[kNumArenaAllocKinds] = { +template <bool kCount> +const char* ArenaAllocatorStatsImpl<kCount>::kAllocNames[kNumArenaAllocKinds] = { "Misc ", "BasicBlock ", "LIR ", @@ -94,14 +95,14 @@ void ArenaAllocatorStatsImpl<kCount>::Dump(std::ostream& os, const Arena* first, const size_t bytes_allocated = BytesAllocated(); os << " MEM: used: " << bytes_allocated << ", allocated: " << malloc_bytes << ", lost: " << lost_bytes << "\n"; - size_t num_allocations = ArenaAllocatorStats::NumAllocations(); + size_t num_allocations = NumAllocations(); if (num_allocations != 0) { os << "Number of arenas allocated: " << num_arenas << ", Number of allocations: " << num_allocations << ", avg size: " << bytes_allocated / num_allocations << "\n"; } os << "===== Allocation by kind\n"; for (int i = 0; i < kNumArenaAllocKinds; i++) { - os << alloc_names[i] << std::setw(10) << alloc_stats_[i] << "\n"; + os << kAllocNames[i] << std::setw(10) << alloc_stats_[i] << "\n"; } } |