Index: src/zone-containers.h |
diff --git a/src/zone-containers.h b/src/zone-containers.h |
index 887ac1c54cab561d8c74acced2c539131f697da5..b0ff7b6cf1bc68297ded6eae7e4bb76f322b18a9 100644 |
--- a/src/zone-containers.h |
+++ b/src/zone-containers.h |
@@ -6,6 +6,7 @@ |
#define V8_ZONE_CONTAINERS_H_ |
#include <deque> |
+#include <list> |
#include <queue> |
#include <stack> |
#include <vector> |
@@ -18,34 +19,45 @@ namespace internal { |
// A wrapper subclass for std::vector to make it easy to construct one |
// that uses a zone allocator. |
template <typename T> |
-class ZoneVector : public std::vector<T, zone_allocator<T> > { |
+class ZoneVector : public std::vector<T, zone_allocator<T>> { |
public: |
// Constructs an empty vector. |
explicit ZoneVector(Zone* zone) |
- : std::vector<T, zone_allocator<T> >(zone_allocator<T>(zone)) {} |
+ : std::vector<T, zone_allocator<T>>(zone_allocator<T>(zone)) {} |
// Constructs a new vector and fills it with {size} elements, each |
// constructed via the default constructor. |
ZoneVector(int size, Zone* zone) |
- : std::vector<T, zone_allocator<T> >(size, T(), zone_allocator<T>(zone)) { |
- } |
+ : std::vector<T, zone_allocator<T>>(size, T(), zone_allocator<T>(zone)) {} |
// Constructs a new vector and fills it with {size} elements, each |
// having the value {def}. |
ZoneVector(int size, T def, Zone* zone) |
- : std::vector<T, zone_allocator<T> >(size, def, zone_allocator<T>(zone)) { |
- } |
+ : std::vector<T, zone_allocator<T>>(size, def, zone_allocator<T>(zone)) {} |
}; |
// A wrapper subclass std::deque to make it easy to construct one |
// that uses a zone allocator. |
template <typename T> |
-class ZoneDeque : public std::deque<T, zone_allocator<T> > { |
+class ZoneDeque : public std::deque<T, zone_allocator<T>> { |
public: |
// Constructs an empty deque. |
explicit ZoneDeque(Zone* zone) |
- : std::deque<T, zone_allocator<T> >(zone_allocator<T>(zone)) {} |
+ : std::deque<T, zone_allocator<T>>(zone_allocator<T>(zone)) {} |
+}; |
+ |
+ |
+// A wrapper subclass std::list to make it easy to construct one |
+// that uses a zone allocator. |
+// TODO(mstarzinger): This should be renamed to ZoneList once we got rid of our |
+// own home-grown ZoneList that actually is a ZoneVector. |
+template <typename T> |
+class ZoneLinkedList : public std::list<T, zone_allocator<T>> { |
+ public: |
+ // Constructs an empty list. |
+ explicit ZoneLinkedList(Zone* zone) |
+ : std::list<T, zone_allocator<T>>(zone_allocator<T>(zone)) {} |
}; |