Line 0
Link Here
|
|
|
1 |
--- boost/atomic/detail/gcc-atomic.hpp 2013-07-20 20:01:35.000000000 +0200 |
2 |
+++ boost/atomic/detail/gcc-atomic.hpp 2014-04-03 18:03:30.000000000 +0200 |
3 |
@@ -958,14 +958,16 @@ |
4 |
|
5 |
public: |
6 |
BOOST_DEFAULTED_FUNCTION(base_atomic(void), {}) |
7 |
- explicit base_atomic(value_type const& v) BOOST_NOEXCEPT : v_(0) |
8 |
+ explicit base_atomic(value_type const& v) BOOST_NOEXCEPT |
9 |
{ |
10 |
+ memset(&v_, 0, sizeof(v_)); |
11 |
memcpy(&v_, &v, sizeof(value_type)); |
12 |
} |
13 |
|
14 |
void store(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT |
15 |
{ |
16 |
- storage_type tmp = 0; |
17 |
+ storage_type tmp; |
18 |
+ memset(&tmp, 0, sizeof(tmp)); |
19 |
memcpy(&tmp, &v, sizeof(value_type)); |
20 |
__atomic_store_n(&v_, tmp, atomics::detail::convert_memory_order_to_gcc(order)); |
21 |
} |
22 |
@@ -980,7 +982,8 @@ |
23 |
|
24 |
value_type exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT |
25 |
{ |
26 |
- storage_type tmp = 0; |
27 |
+ storage_type tmp; |
28 |
+ memset(&tmp, 0, sizeof(tmp)); |
29 |
memcpy(&tmp, &v, sizeof(value_type)); |
30 |
tmp = __atomic_exchange_n(&v_, tmp, atomics::detail::convert_memory_order_to_gcc(order)); |
31 |
value_type res; |
32 |
@@ -994,7 +997,9 @@ |
33 |
memory_order success_order, |
34 |
memory_order failure_order) volatile BOOST_NOEXCEPT |
35 |
{ |
36 |
- storage_type expected_s = 0, desired_s = 0; |
37 |
+ storage_type expected_s, desired_s; |
38 |
+ memset(&expected_s, 0, sizeof(expected_s)); |
39 |
+ memset(&desired_s, 0, sizeof(desired_s)); |
40 |
memcpy(&expected_s, &expected, sizeof(value_type)); |
41 |
memcpy(&desired_s, &desired, sizeof(value_type)); |
42 |
const bool success = __atomic_compare_exchange_n(&v_, &expected_s, desired_s, false, |
43 |
@@ -1010,7 +1015,9 @@ |
44 |
memory_order success_order, |
45 |
memory_order failure_order) volatile BOOST_NOEXCEPT |
46 |
{ |
47 |
- storage_type expected_s = 0, desired_s = 0; |
48 |
+ storage_type expected_s, desired_s; |
49 |
+ memset(&expected_s, 0, sizeof(expected_s)); |
50 |
+ memset(&desired_s, 0, sizeof(desired_s)); |
51 |
memcpy(&expected_s, &expected, sizeof(value_type)); |
52 |
memcpy(&desired_s, &desired, sizeof(value_type)); |
53 |
const bool success = __atomic_compare_exchange_n(&v_, &expected_s, desired_s, true, |