OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "net/quic/quic_fec_group_interface.h" | 5 #include "net/quic/quic_fec_group_interface.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/basictypes.h" | |
10 #include "base/logging.h" | 9 #include "base/logging.h" |
11 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
12 | 11 |
13 namespace net { | 12 namespace net { |
14 | 13 |
15 void QuicFecGroupInterface::XorBuffers(const char* input, | 14 void QuicFecGroupInterface::XorBuffers(const char* input, |
16 size_t size_in_bytes, | 15 size_t size_in_bytes, |
17 char* output) { | 16 char* output) { |
18 #if defined(__i386__) || defined(__x86_64__) | 17 #if defined(__i386__) || defined(__x86_64__) |
19 // On x86, alignment is not required and casting bytes to words is safe. | 18 // On x86, alignment is not required and casting bytes to words is safe. |
(...skipping 21 matching lines...) Expand all Loading... |
41 #else | 40 #else |
42 // On ARM and most other plaforms, the code above could fail due to the | 41 // On ARM and most other plaforms, the code above could fail due to the |
43 // alignment errors. Stick to byte-by-byte comparison. | 42 // alignment errors. Stick to byte-by-byte comparison. |
44 for (size_t offset = 0; offset < size_in_bytes; offset++) { | 43 for (size_t offset = 0; offset < size_in_bytes; offset++) { |
45 output[offset] ^= input[offset]; | 44 output[offset] ^= input[offset]; |
46 } | 45 } |
47 #endif /* defined(__i386__) || defined(__x86_64__) */ | 46 #endif /* defined(__i386__) || defined(__x86_64__) */ |
48 } | 47 } |
49 | 48 |
50 } // namespace net | 49 } // namespace net |
OLD | NEW |