Chromium Code Reviews| Index: third_party/tcmalloc/chromium/src/base/atomicops_internals_portable.h |
| diff --git a/base/atomicops_internals_portable.h b/third_party/tcmalloc/chromium/src/base/atomicops_internals_portable.h |
| similarity index 97% |
| copy from base/atomicops_internals_portable.h |
| copy to third_party/tcmalloc/chromium/src/base/atomicops_internals_portable.h |
| index d28561076dd5f300710c090ebc6d67cca2888b39..f62c8f6468b8aa3efc133b8489c4424e2aa56bda 100644 |
| --- a/base/atomicops_internals_portable.h |
| +++ b/third_party/tcmalloc/chromium/src/base/atomicops_internals_portable.h |
| @@ -33,6 +33,10 @@ |
| #define BASE_ATOMICOPS_INTERNALS_PORTABLE_H_ |
| #include <atomic> |
| +#include <stdint.h> |
| + |
| +typedef int32_t Atomic32; |
| +#define BASE_HAS_ATOMIC64 1 // Use only in tests and base/atomic* |
|
JF
2015/12/26 00:27:24
I'm not sure I understand the comment: isn't this
Nico
2015/12/26 04:13:03
It's like this in the x86 version this patch delet
JF
2015/12/26 15:56:15
Is it required though? If so, could we only suppor
Nico
2015/12/26 16:35:05
In practice, there are three non-test uses of atom
JF
2015/12/26 16:58:37
OK thanks for looking into it!
Yes, I think 2 can
|
| namespace base { |
| namespace subtle { |
| @@ -137,7 +141,8 @@ inline Atomic32 Release_Load(volatile const Atomic32* ptr) { |
| return ((AtomicLocation32)ptr)->load(std::memory_order_relaxed); |
| } |
| -#if defined(ARCH_CPU_64_BITS) |
| +#if defined(BASE_HAS_ATOMIC64) |
| +typedef int64_t Atomic64; |
| typedef volatile std::atomic<Atomic64>* AtomicLocation64; |
| static_assert(sizeof(*(AtomicLocation64) nullptr) == sizeof(Atomic64), |
| @@ -219,8 +224,7 @@ inline Atomic64 Release_Load(volatile const Atomic64* ptr) { |
| MemoryBarrier(); |
| return ((AtomicLocation64)ptr)->load(std::memory_order_relaxed); |
| } |
| - |
| -#endif // defined(ARCH_CPU_64_BITS) |
| +#endif // defined(BASE_HAS_ATOMIC64) |
| } // namespace subtle |
| } // namespace base |