| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CC_BASE_CONTIGUOUS_CONTAINER_H_ | 5 #ifndef CC_BASE_CONTIGUOUS_CONTAINER_H_ |
| 6 #define CC_BASE_CONTIGUOUS_CONTAINER_H_ | 6 #define CC_BASE_CONTIGUOUS_CONTAINER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 IteratorWrapper<std::vector<void*>::reverse_iterator, BaseElementType>; | 123 IteratorWrapper<std::vector<void*>::reverse_iterator, BaseElementType>; |
| 124 using const_reverse_iterator = | 124 using const_reverse_iterator = |
| 125 IteratorWrapper<std::vector<void*>::const_reverse_iterator, | 125 IteratorWrapper<std::vector<void*>::const_reverse_iterator, |
| 126 const BaseElementType>; | 126 const BaseElementType>; |
| 127 | 127 |
| 128 explicit ContiguousContainer(size_t max_object_size) | 128 explicit ContiguousContainer(size_t max_object_size) |
| 129 : ContiguousContainerBase(Align(max_object_size)) {} | 129 : ContiguousContainerBase(Align(max_object_size)) {} |
| 130 ContiguousContainer(size_t max_object_size, size_t initial_size_bytes) | 130 ContiguousContainer(size_t max_object_size, size_t initial_size_bytes) |
| 131 : ContiguousContainerBase(Align(max_object_size), initial_size_bytes) {} | 131 : ContiguousContainerBase(Align(max_object_size), initial_size_bytes) {} |
| 132 | 132 |
| 133 DISABLE_CFI_PERF |
| 133 ~ContiguousContainer() { | 134 ~ContiguousContainer() { |
| 134 for (auto& element : *this) { | 135 for (auto& element : *this) { |
| 135 // MSVC incorrectly reports this variable as unused. | 136 // MSVC incorrectly reports this variable as unused. |
| 136 (void)element; | 137 (void)element; |
| 137 element.~BaseElementType(); | 138 element.~BaseElementType(); |
| 138 } | 139 } |
| 139 } | 140 } |
| 140 | 141 |
| 141 using ContiguousContainerBase::size; | 142 using ContiguousContainerBase::size; |
| 142 using ContiguousContainerBase::empty; | 143 using ContiguousContainerBase::empty; |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 DCHECK_EQ(aligned_size % alignment, 0u); | 216 DCHECK_EQ(aligned_size % alignment, 0u); |
| 216 DCHECK_GE(aligned_size, size); | 217 DCHECK_GE(aligned_size, size); |
| 217 DCHECK_LT(aligned_size, size + alignment); | 218 DCHECK_LT(aligned_size, size + alignment); |
| 218 return aligned_size; | 219 return aligned_size; |
| 219 } | 220 } |
| 220 }; | 221 }; |
| 221 | 222 |
| 222 } // namespace cc | 223 } // namespace cc |
| 223 | 224 |
| 224 #endif // CC_BASE_CONTIGUOUS_CONTAINER_H_ | 225 #endif // CC_BASE_CONTIGUOUS_CONTAINER_H_ |
| OLD | NEW |