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

Unified Diff: src/utils.h

Issue 157443002: Add basic support for STL containers allocated in Zones (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review feedback Created 6 years, 10 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/list.h ('k') | src/zone-allocator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils.h
diff --git a/src/utils.h b/src/utils.h
index b11d756b8a97281135590147102e2e4536a8197a..2e7c494d63187afaa93005551be66233bb5561bf 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -1140,6 +1140,21 @@ class BailoutId {
int id_;
};
+
+template <class C>
+class ContainerPointerWrapper {
+ public:
+ typedef typename C::iterator iterator;
+ typedef typename C::reverse_iterator reverse_iterator;
+ explicit ContainerPointerWrapper(C* container) : container_(container) {}
+ iterator begin() { return container_->begin(); }
+ iterator end() { return container_->end(); }
+ reverse_iterator rbegin() { return container_->rbegin(); }
+ reverse_iterator rend() { return container_->rend(); }
+ private:
+ C* container_;
+};
+
} } // namespace v8::internal
#endif // V8_UTILS_H_
« no previous file with comments | « src/list.h ('k') | src/zone-allocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698