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 "base/basictypes.h" | 8 #include <stddef.h> |
| 9 |
9 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/macros.h" |
10 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
11 #include "base/stl_util.h" | 13 #include "base/stl_util.h" |
12 #include "cc/base/cc_export.h" | 14 #include "cc/base/cc_export.h" |
13 | 15 |
14 namespace cc { | 16 namespace cc { |
15 | 17 |
16 // ContiguousContainer is a container which stores a list of heterogeneous | 18 // ContiguousContainer is a container which stores a list of heterogeneous |
17 // objects (in particular, of varying sizes), packed next to one another in | 19 // objects (in particular, of varying sizes), packed next to one another in |
18 // memory. Objects are never relocated, so it is safe to store pointers to them | 20 // memory. Objects are never relocated, so it is safe to store pointers to them |
19 // for the lifetime of the container (unless the object is removed). | 21 // for the lifetime of the container (unless the object is removed). |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 DCHECK_EQ(aligned_size % alignment, 0u); | 207 DCHECK_EQ(aligned_size % alignment, 0u); |
206 DCHECK_GE(aligned_size, size); | 208 DCHECK_GE(aligned_size, size); |
207 DCHECK_LT(aligned_size, size + alignment); | 209 DCHECK_LT(aligned_size, size + alignment); |
208 return aligned_size; | 210 return aligned_size; |
209 } | 211 } |
210 }; | 212 }; |
211 | 213 |
212 } // namespace cc | 214 } // namespace cc |
213 | 215 |
214 #endif // CC_BASE_CONTIGUOUS_CONTAINER_H_ | 216 #endif // CC_BASE_CONTIGUOUS_CONTAINER_H_ |
OLD | NEW |