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

Side by Side 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, 3 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 unified diff | Download patch
« no previous file with comments | « src/ast/scopes.cc ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_ZONE_CONTAINERS_H_ 5 #ifndef V8_ZONE_CONTAINERS_H_
6 #define V8_ZONE_CONTAINERS_H_ 6 #define V8_ZONE_CONTAINERS_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <list> 9 #include <list>
10 #include <map> 10 #include <map>
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 template <typename K, typename V, typename Compare = std::less<K>> 115 template <typename K, typename V, typename Compare = std::less<K>>
116 class ZoneMap 116 class ZoneMap
117 : public std::map<K, V, Compare, zone_allocator<std::pair<const K, V>>> { 117 : public std::map<K, V, Compare, zone_allocator<std::pair<const K, V>>> {
118 public: 118 public:
119 // Constructs an empty map. 119 // Constructs an empty map.
120 explicit ZoneMap(Zone* zone) 120 explicit ZoneMap(Zone* zone)
121 : std::map<K, V, Compare, zone_allocator<std::pair<const K, V>>>( 121 : std::map<K, V, Compare, zone_allocator<std::pair<const K, V>>>(
122 Compare(), zone_allocator<std::pair<const K, V>>(zone)) {} 122 Compare(), zone_allocator<std::pair<const K, V>>(zone)) {}
123 }; 123 };
124 124
125 // A wrapper subclass for std::multimap to make it easy to construct one that
126 // uses a zone allocator.
127 template <typename K, typename V, typename Compare = std::less<K>>
128 class ZoneMultimap
129 : public std::multimap<K, V, Compare,
130 zone_allocator<std::pair<const K, V>>> {
131 public:
132 // Constructs an empty multimap.
133 explicit ZoneMultimap(Zone* zone)
134 : std::multimap<K, V, Compare, zone_allocator<std::pair<const K, V>>>(
135 Compare(), zone_allocator<std::pair<const K, V>>(zone)) {}
136 };
125 137
126 // Typedefs to shorten commonly used vectors. 138 // Typedefs to shorten commonly used vectors.
127 typedef ZoneVector<bool> BoolVector; 139 typedef ZoneVector<bool> BoolVector;
128 typedef ZoneVector<int> IntVector; 140 typedef ZoneVector<int> IntVector;
129 141
130 } // namespace internal 142 } // namespace internal
131 } // namespace v8 143 } // namespace v8
132 144
133 #endif // V8_ZONE_CONTAINERS_H_ 145 #endif // V8_ZONE_CONTAINERS_H_
OLDNEW
« 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