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

Unified Diff: src/zone-inl.h

Issue 7374002: Refactor allocation policies. Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 5 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/zone.h ('k') | test/cctest/test-list.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/zone-inl.h
diff --git a/src/zone-inl.h b/src/zone-inl.h
index 6e2d558a60625a1fb055c6a5c52ffd5bc44ec622..90817dad1b5778f514a995926b85dbc175adecfe 100644
--- a/src/zone-inl.h
+++ b/src/zone-inl.h
@@ -86,7 +86,7 @@ ZoneSplayTree<Config>::~ZoneSplayTree() {
// Reset the root to avoid unneeded iteration over all tree nodes
// in the destructor. For a zone-allocated tree, nodes will be
// freed by the Zone.
- SplayTree<Config, ZoneListAllocationPolicy>::ResetRoot();
+ SplayTree<Config, ZoneListAllocator>::ResetRoot();
}
@@ -102,20 +102,20 @@ void* ZoneObject::operator new(size_t size, Zone* zone) {
}
-inline void* ZoneListAllocationPolicy::New(int size) {
+inline void* ZoneListAllocator::New(int size) {
return ZONE->New(size);
}
template <typename T>
-void* ZoneList<T>::operator new(size_t size) {
- return ZONE->New(static_cast<int>(size));
+void* ZoneList<T>::operator new(size_t size, Zone* zone) {
+ return zone->New(static_cast<int>(size));
}
-template <typename T>
-void* ZoneList<T>::operator new(size_t size, Zone* zone) {
- return zone->New(static_cast<int>(size));
+template<typename T>
+ZoneList<T>* ZoneList<T>::New(Zone* zone, int capacity) {
+ return new(zone) ZoneList(zone, capacity);
}
« no previous file with comments | « src/zone.h ('k') | test/cctest/test-list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698