summaryrefslogtreecommitdiff
path: root/runtime/base/allocator.h
diff options
context:
space:
mode:
author Mathieu Chartier <mathieuc@google.com> 2015-10-27 21:10:08 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2015-10-27 21:10:08 +0000
commit3dca4c04170bb4c7b26609e55f3f4966d46b681a (patch)
treebcdd800831f98a896b2b712932e769f46fbeefab /runtime/base/allocator.h
parent9e1b56f0e77aa5b6c72374b86d0cef58484ddcaa (diff)
parent0f8e0723d67bd75125705b2707c36927beabd886 (diff)
Merge "Use HashMap for DexFileVerifier"
Diffstat (limited to 'runtime/base/allocator.h')
-rw-r--r--runtime/base/allocator.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/runtime/base/allocator.h b/runtime/base/allocator.h
index ad255b8694..969f5b953f 100644
--- a/runtime/base/allocator.h
+++ b/runtime/base/allocator.h
@@ -22,6 +22,7 @@
#include <unordered_map>
#include "atomic.h"
+#include "base/hash_map.h"
#include "base/macros.h"
#include "base/mutex.h"
#include "base/type_static_if.h"
@@ -170,6 +171,14 @@ template<class Key,
using AllocationTrackingUnorderedMap = std::unordered_map<
Key, T, Hash, Pred, TrackingAllocator<std::pair<const Key, T>, kTag>>;
+template<class Key,
+ class T,
+ class EmptyFn,
+ AllocatorTag kTag,
+ class Hash = std::hash<Key>,
+ class Pred = std::equal_to<Key>>
+using AllocationTrackingHashMap = HashMap<
+ Key, T, EmptyFn, Hash, Pred, TrackingAllocator<std::pair<Key, T>, kTag>>;
} // namespace art
#endif // ART_RUNTIME_BASE_ALLOCATOR_H_