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

Unified Diff: third_party/WebKit/Source/platform/wtf/StdLibExtras.h

Issue 2932053002: Use C++11 alignment primitives (Closed)
Patch Set: Put back ALIGNAS 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
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..eeb441497cc09b486e4b4c76e1ef8df305b01325 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_;
+ typename std::aligned_storage<sizeof(T), alignof(T)>::type object_;
};
InstanceStorage<WrapperType> instance_;

Powered by Google App Engine
This is Rietveld 408576698