OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This file is an internal atomic implementation, use base/atomicops.h instead. | 5 // This file is an internal atomic implementation, use base/atomicops.h instead. |
6 | 6 |
7 #ifndef BASE_ATOMICOPS_INTERNALS_ATOMICWORD_COMPAT_H_ | 7 #ifndef BASE_ATOMICOPS_INTERNALS_ATOMICWORD_COMPAT_H_ |
8 #define BASE_ATOMICOPS_INTERNALS_ATOMICWORD_COMPAT_H_ | 8 #define BASE_ATOMICOPS_INTERNALS_ATOMICWORD_COMPAT_H_ |
9 | 9 |
10 // AtomicWord is a synonym for intptr_t, and Atomic32 is a synonym for int32, | 10 #include <stdint.h> |
| 11 |
| 12 #include "build/build_config.h" |
| 13 |
| 14 // AtomicWord is a synonym for intptr_t, and Atomic32 is a synonym for int32_t, |
11 // which in turn means int. On some LP32 platforms, intptr_t is an int, but | 15 // which in turn means int. On some LP32 platforms, intptr_t is an int, but |
12 // on others, it's a long. When AtomicWord and Atomic32 are based on different | 16 // on others, it's a long. When AtomicWord and Atomic32 are based on different |
13 // fundamental types, their pointers are incompatible. | 17 // fundamental types, their pointers are incompatible. |
14 // | 18 // |
15 // This file defines function overloads to allow both AtomicWord and Atomic32 | 19 // This file defines function overloads to allow both AtomicWord and Atomic32 |
16 // data to be used with this interface. | 20 // data to be used with this interface. |
17 // | 21 // |
18 // On LP64 platforms, AtomicWord and Atomic64 are both always long, | 22 // On LP64 platforms, AtomicWord and Atomic64 are both always long, |
19 // so this problem doesn't occur. | 23 // so this problem doesn't occur. |
20 | 24 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 return base::subtle::Release_Load( | 95 return base::subtle::Release_Load( |
92 reinterpret_cast<volatile const Atomic32*>(ptr)); | 96 reinterpret_cast<volatile const Atomic32*>(ptr)); |
93 } | 97 } |
94 | 98 |
95 } // namespace subtle | 99 } // namespace subtle |
96 } // namespace base | 100 } // namespace base |
97 | 101 |
98 #endif // !defined(ARCH_CPU_64_BITS) | 102 #endif // !defined(ARCH_CPU_64_BITS) |
99 | 103 |
100 #endif // BASE_ATOMICOPS_INTERNALS_ATOMICWORD_COMPAT_H_ | 104 #endif // BASE_ATOMICOPS_INTERNALS_ATOMICWORD_COMPAT_H_ |
OLD | NEW |