Fix arena allocation counting.
Add the "CHA" allocation kind description. Move the
statistics to the heap to avoid excessively large frames
triggering errors with -Werror, -Wframe-larger-than=.
Test: m test-art-host
Test: m test-art-host with arena allocation counting.
Change-Id: I7947a3a17b4c1ed773742516b1f7ab9a58c92150
diff --git a/runtime/base/arena_allocator.h b/runtime/base/arena_allocator.h
index 2feb28a..6c764cb 100644
--- a/runtime/base/arena_allocator.h
+++ b/runtime/base/arena_allocator.h
@@ -21,6 +21,7 @@
#include <stddef.h>
#include "base/bit_utils.h"
+#include "base/dchecked_vector.h"
#include "base/memory_tool.h"
#include "debug_stack.h"
#include "macros.h"
@@ -132,8 +133,7 @@
private:
size_t num_allocations_;
- // TODO: Use std::array<size_t, kNumArenaAllocKinds> from C++11 when we upgrade the STL.
- size_t alloc_stats_[kNumArenaAllocKinds]; // Bytes used by various allocation kinds.
+ dchecked_vector<size_t> alloc_stats_; // Bytes used by various allocation kinds.
static const char* const kAllocNames[];
};