Add DCHECKs to ArenaVector and ScopedArenaVector.
Implement dchecked_vector<> template that DCHECK()s element
access and insert()/emplace()/erase() positions. Change the
ArenaVector<> and ScopedArenaVector<> aliases to use the new
template instead of std::vector<>. Remove DCHECK()s that
have now become unnecessary from the Optimizing compiler.
Change-Id: Ib8506bd30d223f68f52bd4476c76d9991acacadc
diff --git a/runtime/base/arena_containers.h b/runtime/base/arena_containers.h
index e7ea09d..66b5289 100644
--- a/runtime/base/arena_containers.h
+++ b/runtime/base/arena_containers.h
@@ -20,9 +20,9 @@
#include <deque>
#include <queue>
#include <set>
-#include <vector>
#include "arena_allocator.h"
+#include "base/dchecked_vector.h"
#include "safe_map.h"
namespace art {
@@ -48,7 +48,7 @@
using ArenaQueue = std::queue<T, ArenaDeque<T>>;
template <typename T>
-using ArenaVector = std::vector<T, ArenaAllocatorAdapter<T>>;
+using ArenaVector = dchecked_vector<T, ArenaAllocatorAdapter<T>>;
template <typename T, typename Comparator = std::less<T>>
using ArenaSet = std::set<T, Comparator, ArenaAllocatorAdapter<T>>;