Skip to content

Commit 96cb909

Browse files
nicoCommit bot
authored andcommitted
Allocators for map<K, V> need to allocate pair<const K, V>.
BUG=chromium:562227 LOG=n Review URL: https://codereview.chromium.org/1479893002 Cr-Commit-Position: refs/heads/master@{#32360}
1 parent e03cada commit 96cb909

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/compiler/instruction.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1083,7 +1083,7 @@ class InstructionBlock final : public ZoneObject {
10831083

10841084
typedef ZoneDeque<Constant> ConstantDeque;
10851085
typedef std::map<int, Constant, std::less<int>,
1086-
zone_allocator<std::pair<int, Constant> > > ConstantMap;
1086+
zone_allocator<std::pair<const int, Constant> > > ConstantMap;
10871087

10881088
typedef ZoneDeque<Instruction*> InstructionDeque;
10891089
typedef ZoneDeque<ReferenceMap*> ReferenceMapDeque;

src/zone-containers.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,12 @@ class ZoneSet : public std::set<K, Compare, zone_allocator<K>> {
114114
// a zone allocator.
115115
template <typename K, typename V, typename Compare = std::less<K>>
116116
class ZoneMap
117-
: public std::map<K, V, Compare, zone_allocator<std::pair<K, V>>> {
117+
: public std::map<K, V, Compare, zone_allocator<std::pair<const K, V>>> {
118118
public:
119119
// Constructs an empty map.
120120
explicit ZoneMap(Zone* zone)
121-
: std::map<K, V, Compare, zone_allocator<std::pair<K, V>>>(
122-
Compare(), zone_allocator<std::pair<K, V>>(zone)) {}
121+
: std::map<K, V, Compare, zone_allocator<std::pair<const K, V>>>(
122+
Compare(), zone_allocator<std::pair<const K, V>>(zone)) {}
123123
};
124124

125125

0 commit comments

Comments
 (0)