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

Unified Diff: cc/base/list_container.h

Issue 2932053002: Use C++11 alignment primitives (Closed)
Patch Set: Fix merge Created 3 years, 6 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/process/launch_posix.cc ('k') | cc/base/list_container_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/base/list_container.h
diff --git a/cc/base/list_container.h b/cc/base/list_container.h
index 93a6a67fc6d8a5ba0efc9ee5229076e2d4819f9a..bafee7970ceadb4130b7e2c39aa6e698c8bbbf23 100644
--- a/cc/base/list_container.h
+++ b/cc/base/list_container.h
@@ -101,7 +101,7 @@ class ListContainer {
// Allocate().
template <typename DerivedElementType>
DerivedElementType* AllocateAndConstruct() {
- return new (helper_.Allocate(ALIGNOF(DerivedElementType),
+ return new (helper_.Allocate(alignof(DerivedElementType),
sizeof(DerivedElementType)))
DerivedElementType;
}
@@ -110,7 +110,7 @@ class ListContainer {
// Allocate().
template <typename DerivedElementType>
DerivedElementType* AllocateAndCopyFrom(const DerivedElementType* source) {
- return new (helper_.Allocate(ALIGNOF(DerivedElementType),
+ return new (helper_.Allocate(alignof(DerivedElementType),
sizeof(DerivedElementType)))
DerivedElementType(*source);
}
@@ -154,7 +154,7 @@ class ListContainer {
template <typename DerivedElementType>
DerivedElementType* AppendByMoving(DerivedElementType* item) {
size_t max_size_for_derived_class = helper_.MaxSizeForDerivedClass();
- void* new_item = helper_.Allocate(ALIGNOF(DerivedElementType),
+ void* new_item = helper_.Allocate(alignof(DerivedElementType),
max_size_for_derived_class);
memcpy(new_item, static_cast<void*>(item), max_size_for_derived_class);
// Construct a new element in-place so it can be destructed safely.
« no previous file with comments | « base/process/launch_posix.cc ('k') | cc/base/list_container_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698