Bug 1155864 - Rip out Windows intrinsics from Atomics.h and allow Atomic to hold 64-bit types everywhere. r=Waldo
authorSeth Fowler <mark.seth.fowler@gmail.com>
Fri, 17 Apr 2015 18:40:52 -0700
changeset 271169 8e8f3e6e0739797c5a544eb6fb30f0e958150538
parent 271168 720d0e4030454d43299ab3c23fc97467fdaa3176
child 271170 0500d91113bb7423d036cd0bb7c3ce66d654ff95
child 271184 d94427989ce3e27e238eca7600a5772a37d6fa84
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersWaldo
bugs1155864
milestone40.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1155864 - Rip out Windows intrinsics from Atomics.h and allow Atomic to hold 64-bit types everywhere. r=Waldo
mfbt/Atomics.h
mfbt/tests/TestAtomics.cpp
--- a/mfbt/Atomics.h
+++ b/mfbt/Atomics.h
@@ -506,20 +506,18 @@ struct AtomicIntrinsics<T*, Order> : pub
 
 namespace mozilla {
 
 namespace detail {
 
 template<typename T, MemoryOrdering Order>
 class AtomicBase
 {
-  // We only support 32-bit types on 32-bit Windows, which constrains our
-  // implementation elsewhere.  But we support pointer-sized types everywhere.
-  static_assert(sizeof(T) == 4 || (sizeof(uintptr_t) == 8 && sizeof(T) == 8),
-                "mozilla/Atomics.h only supports 32-bit and pointer-sized types");
+  static_assert(sizeof(T) == 4 || sizeof(T) == 8,
+                "mozilla/Atomics.h only supports 32-bit and 64-bit types");
 
 protected:
   typedef typename detail::AtomicIntrinsics<T, Order> Intrinsics;
   typename Intrinsics::ValueType mValue;
 
 public:
   MOZ_CONSTEXPR AtomicBase() : mValue() {}
   explicit MOZ_CONSTEXPR AtomicBase(T aInit) : mValue(aInit) {}
--- a/mfbt/tests/TestAtomics.cpp
+++ b/mfbt/tests/TestAtomics.cpp
@@ -234,16 +234,18 @@ TestBool()
 
 #undef A
 
 int
 main()
 {
   TestType<uint32_t>();
   TestType<int32_t>();
+  TestType<uint64_t>();
+  TestType<int64_t>();
   TestType<intptr_t>();
   TestType<uintptr_t>();
   TestPointer<int>();
   TestPointer<float>();
   TestPointer<uint16_t*>();
   TestPointer<uint32_t*>();
   TestEnum();
   TestBool();