ART: Use arena allocator with HashSet/HashMap.
Allow passing ArenaAllocatorAdapter (or any other allocator)
to HashSet/HashMap and create appropriate Arena- aliases.
Use the ArenaHashMap in StackMapsStream.
Update arena allocator adapters' construct()/destroy() to
C++11 std::allocator<> API.
Change-Id: I18544f718f84c6d6580228dd35297daf7f6afb5e
diff --git a/runtime/base/hash_map.h b/runtime/base/hash_map.h
index eab80ff..b18d586 100644
--- a/runtime/base/hash_map.h
+++ b/runtime/base/hash_map.h
@@ -51,8 +51,22 @@
template <class Key, class Value, class EmptyFn,
class HashFn = std::hash<Key>, class Pred = std::equal_to<Key>,
class Alloc = std::allocator<std::pair<Key, Value>>>
-class HashMap : public HashSet<std::pair<Key, Value>, EmptyFn, HashMapWrapper<HashFn>,
- HashMapWrapper<Pred>, Alloc> {
+class HashMap : public HashSet<std::pair<Key, Value>,
+ EmptyFn,
+ HashMapWrapper<HashFn>,
+ HashMapWrapper<Pred>,
+ Alloc> {
+ private:
+ using Base = HashSet<std::pair<Key, Value>,
+ EmptyFn,
+ HashMapWrapper<HashFn>,
+ HashMapWrapper<Pred>,
+ Alloc>;
+
+ public:
+ HashMap() : Base() { }
+ explicit HashMap(const Alloc& alloc)
+ : Base(alloc) { }
};
} // namespace art