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

Side by Side Diff: third_party/WebKit/Source/wtf/Vector.h

Issue 2518253002: Move Partition Allocator into Chromium base. (Closed)
Patch Set: Rebase and resolve conflict. Created 4 years 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 }; 790 };
791 // Heap-allocated vectors with no inlineCapacity never need a destructor. 791 // Heap-allocated vectors with no inlineCapacity never need a destructor.
792 template <typename T, 792 template <typename T,
793 size_t inlineCapacity = 0, 793 size_t inlineCapacity = 0,
794 typename Allocator = PartitionAllocator> 794 typename Allocator = PartitionAllocator>
795 class Vector 795 class Vector
796 : private VectorBuffer<T, INLINE_CAPACITY, Allocator>, 796 : private VectorBuffer<T, INLINE_CAPACITY, Allocator>,
797 public ConditionalDestructor<Vector<T, INLINE_CAPACITY, Allocator>, 797 public ConditionalDestructor<Vector<T, INLINE_CAPACITY, Allocator>,
798 (INLINE_CAPACITY == 0) && 798 (INLINE_CAPACITY == 0) &&
799 Allocator::isGarbageCollected> { 799 Allocator::isGarbageCollected> {
800 WTF_USE_ALLOCATOR(Vector, Allocator); 800 USE_ALLOCATOR(Vector, Allocator);
801 using Base = VectorBuffer<T, INLINE_CAPACITY, Allocator>; 801 using Base = VectorBuffer<T, INLINE_CAPACITY, Allocator>;
802 using TypeOperations = VectorTypeOperations<T>; 802 using TypeOperations = VectorTypeOperations<T>;
803 using OffsetRange = typename Base::OffsetRange; 803 using OffsetRange = typename Base::OffsetRange;
804 804
805 public: 805 public:
806 typedef T ValueType; 806 typedef T ValueType;
807 typedef T value_type; 807 typedef T value_type;
808 808
809 typedef T* iterator; 809 typedef T* iterator;
810 typedef const T* const_iterator; 810 typedef const T* const_iterator;
(...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after
1613 visitor, *const_cast<T*>(bufferEntry)); 1613 visitor, *const_cast<T*>(bufferEntry));
1614 checkUnusedSlots(buffer() + size(), buffer() + capacity()); 1614 checkUnusedSlots(buffer() + size(), buffer() + capacity());
1615 } 1615 }
1616 } 1616 }
1617 1617
1618 } // namespace WTF 1618 } // namespace WTF
1619 1619
1620 using WTF::Vector; 1620 using WTF::Vector;
1621 1621
1622 #endif // WTF_Vector_h 1622 #endif // WTF_Vector_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698