Skip to content

Commit

Permalink
Allocators for map<K, V> need to allocate pair<const K, V>.
Browse files Browse the repository at this point in the history
BUG=chromium:562227
LOG=n

Review URL: https://codereview.chromium.org/1479893002

Cr-Commit-Position: refs/heads/master@{#32360}
  • Loading branch information
nico authored and Commit bot committed Nov 27, 2015
1 parent e03cada commit 96cb909
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/compiler/instruction.h
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,7 @@ class InstructionBlock final : public ZoneObject {

typedef ZoneDeque<Constant> ConstantDeque;
typedef std::map<int, Constant, std::less<int>,
zone_allocator<std::pair<int, Constant> > > ConstantMap;
zone_allocator<std::pair<const int, Constant> > > ConstantMap;

typedef ZoneDeque<Instruction*> InstructionDeque;
typedef ZoneDeque<ReferenceMap*> ReferenceMapDeque;
Expand Down
6 changes: 3 additions & 3 deletions src/zone-containers.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,12 @@ class ZoneSet : public std::set<K, Compare, zone_allocator<K>> {
// a zone allocator.
template <typename K, typename V, typename Compare = std::less<K>>
class ZoneMap
: public std::map<K, V, Compare, zone_allocator<std::pair<K, V>>> {
: public std::map<K, V, Compare, zone_allocator<std::pair<const K, V>>> {
public:
// Constructs an empty map.
explicit ZoneMap(Zone* zone)
: std::map<K, V, Compare, zone_allocator<std::pair<K, V>>>(
Compare(), zone_allocator<std::pair<K, V>>(zone)) {}
: std::map<K, V, Compare, zone_allocator<std::pair<const K, V>>>(
Compare(), zone_allocator<std::pair<const K, V>>(zone)) {}
};


Expand Down

0 comments on commit 96cb909

Please sign in to comment.