Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(192)

Unified Diff: src/zone-containers.h

Issue 2273013002: [modules] Split exports into regular and special, store regular ones in a multimap. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: git cl format Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ast/scopes.cc ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/zone-containers.h
diff --git a/src/zone-containers.h b/src/zone-containers.h
index 79b168c37eab7a16969d1b91384ba1f74e3d0423..2b7d110eaa70121bad08b0f03fd7f052e55f0a70 100644
--- a/src/zone-containers.h
+++ b/src/zone-containers.h
@@ -122,6 +122,18 @@ class ZoneMap
Compare(), zone_allocator<std::pair<const K, V>>(zone)) {}
};
+// A wrapper subclass for std::multimap to make it easy to construct one that
+// uses a zone allocator.
+template <typename K, typename V, typename Compare = std::less<K>>
+class ZoneMultimap
+ : public std::multimap<K, V, Compare,
+ zone_allocator<std::pair<const K, V>>> {
+ public:
+ // Constructs an empty multimap.
+ explicit ZoneMultimap(Zone* zone)
+ : std::multimap<K, V, Compare, zone_allocator<std::pair<const K, V>>>(
+ Compare(), zone_allocator<std::pair<const K, V>>(zone)) {}
+};
// Typedefs to shorten commonly used vectors.
typedef ZoneVector<bool> BoolVector;
« no previous file with comments | « src/ast/scopes.cc ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698