Chromium Code Reviews| Index: src/zone-inl.h |
| diff --git a/src/zone-inl.h b/src/zone-inl.h |
| index ee96ec052eb9863201fabbbed2f211b33d8e9c8e..380fa7ca6f9a3020dc774ecf2a92bed8bf9a2d3c 100644 |
| --- a/src/zone-inl.h |
| +++ b/src/zone-inl.h |
| @@ -90,7 +90,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, ZoneAllocationPolicy>::ResetRoot(); |
| } |
| @@ -106,20 +106,23 @@ void* ZoneObject::operator new(size_t size, Zone* zone) { |
| } |
| -inline void* ZoneListAllocationPolicy::New(int size) { |
| +void* ZoneAllocator::New(int size) { |
| return ZONE->New(size); |
| } |
| +// The ZoneAllocator is used to specialize the List implementation to |
| +// allocate ZoneLists and their elements in the current Zone. |
|
danno
2012/05/25 11:03:37
Does the comment apply to the following code? I'm
|
| 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)); |
| +// De-allocation attempts are silently ignored. |
|
danno
2012/05/25 11:03:37
This comment seems unrelated?
|
| +template<typename T> |
| +void* ZoneList<T>::operator new(size_t size) { |
| + return List<T, ZoneAllocationPolicy>::operator new(size); |
|
danno
2012/05/25 11:03:37
Why did you move this function? And why does it n
|
| } |