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

Unified Diff: third_party/WebKit/Source/platform/wtf/StdLibExtras.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 | « styleguide/c++/c++11.html ('k') | third_party/crashpad/crashpad/util/stdlib/aligned_allocator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/wtf/StdLibExtras.h
diff --git a/third_party/WebKit/Source/platform/wtf/StdLibExtras.h b/third_party/WebKit/Source/platform/wtf/StdLibExtras.h
index 1cf496793f81911804a6dcff68ed1fe5550191e2..092d2ee63d6c817841354c21054879f753498577 100644
--- a/third_party/WebKit/Source/platform/wtf/StdLibExtras.h
+++ b/third_party/WebKit/Source/platform/wtf/StdLibExtras.h
@@ -27,7 +27,6 @@
#define WTF_StdLibExtras_h
#include <cstddef>
-#include "base/memory/aligned_memory.h"
#include "base/numerics/safe_conversions.h"
#include "platform/wtf/Assertions.h"
#include "platform/wtf/CPU.h"
@@ -163,12 +162,12 @@ class StaticSingleton final {
public:
template <typename HeapNew, typename PlacementNew>
InstanceStorage(const HeapNew&, const PlacementNew& placement_new) {
- placement_new(object_.void_data());
+ placement_new(&object_);
}
- T* Get() { return object_.template data_as<T>(); }
+ T* Get() { return reinterpret_cast<T*>(object_); }
private:
- base::AlignedMemory<sizeof(T), ALIGNOF(T)> object_;
+ alignas(T) char object_[sizeof(T)];
};
InstanceStorage<WrapperType> instance_;
« no previous file with comments | « styleguide/c++/c++11.html ('k') | third_party/crashpad/crashpad/util/stdlib/aligned_allocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698