| 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 ContiguousContainer_h | 5 #ifndef ContiguousContainer_h |
| 6 #define ContiguousContainer_h | 6 #define ContiguousContainer_h |
| 7 | 7 |
| 8 #include <cstddef> |
| 9 #include <iterator> |
| 10 #include <memory> |
| 11 #include <utility> |
| 8 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 9 #include "platform/PlatformExport.h" | 13 #include "platform/PlatformExport.h" |
| 10 #include "wtf/Alignment.h" | 14 #include "wtf/Alignment.h" |
| 11 #include "wtf/Allocator.h" | 15 #include "wtf/Allocator.h" |
| 12 #include "wtf/Compiler.h" | 16 #include "wtf/Compiler.h" |
| 13 #include "wtf/Noncopyable.h" | 17 #include "wtf/Noncopyable.h" |
| 14 #include "wtf/TypeTraits.h" | 18 #include "wtf/TypeTraits.h" |
| 15 #include "wtf/Vector.h" | 19 #include "wtf/Vector.h" |
| 16 #include <cstddef> | |
| 17 #include <iterator> | |
| 18 #include <memory> | |
| 19 #include <utility> | |
| 20 | 20 |
| 21 namespace blink { | 21 namespace blink { |
| 22 | 22 |
| 23 // ContiguousContainer is a container which stores a list of heterogeneous | 23 // ContiguousContainer is a container which stores a list of heterogeneous |
| 24 // objects (in particular, of varying sizes), packed next to one another in | 24 // objects (in particular, of varying sizes), packed next to one another in |
| 25 // memory. Objects are never relocated, so it is safe to store pointers to them | 25 // memory. Objects are never relocated, so it is safe to store pointers to them |
| 26 // for the lifetime of the container (unless the object is removed). | 26 // for the lifetime of the container (unless the object is removed). |
| 27 // | 27 // |
| 28 // Memory is allocated in a series of buffers (with exponential growth). When an | 28 // Memory is allocated in a series of buffers (with exponential growth). When an |
| 29 // object is allocated, it is given only the space it requires (possibly with | 29 // object is allocated, it is given only the space it requires (possibly with |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 DCHECK_EQ(alignedSize % alignment, 0u); | 245 DCHECK_EQ(alignedSize % alignment, 0u); |
| 246 DCHECK_GE(alignedSize, size); | 246 DCHECK_GE(alignedSize, size); |
| 247 DCHECK_LT(alignedSize, size + alignment); | 247 DCHECK_LT(alignedSize, size + alignment); |
| 248 return alignedSize; | 248 return alignedSize; |
| 249 } | 249 } |
| 250 }; | 250 }; |
| 251 | 251 |
| 252 } // namespace blink | 252 } // namespace blink |
| 253 | 253 |
| 254 #endif // ContiguousContainer_h | 254 #endif // ContiguousContainer_h |
| OLD | NEW |