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_packet_creator.h" | 5 #include "net/quic/quic_packet_creator.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 // TODO(ckrasic) - investigate what to do about prefetch directives. | 271 // TODO(ckrasic) - investigate what to do about prefetch directives. |
272 // prefetch(next_base, PREFETCH_HINT_T0); | 272 // prefetch(next_base, PREFETCH_HINT_T0); |
273 if (iov.iov[iovnum + 1].iov_len >= 64) { | 273 if (iov.iov[iovnum + 1].iov_len >= 64) { |
274 // TODO(ckrasic) - investigate what to do about prefetch directives. | 274 // TODO(ckrasic) - investigate what to do about prefetch directives. |
275 // prefetch(next_base + CACHELINE_SIZE, PREFETCH_HINT_T0); | 275 // prefetch(next_base + CACHELINE_SIZE, PREFETCH_HINT_T0); |
276 } | 276 } |
277 } | 277 } |
278 | 278 |
279 const char* src = static_cast<char*>(iov.iov[iovnum].iov_base) + iov_offset; | 279 const char* src = static_cast<char*>(iov.iov[iovnum].iov_base) + iov_offset; |
280 while (true) { | 280 while (true) { |
281 memmove(buffer, src, copy_len); | 281 memcpy(buffer, src, copy_len); |
282 length -= copy_len; | 282 length -= copy_len; |
283 buffer += copy_len; | 283 buffer += copy_len; |
284 if (length == 0 || ++iovnum >= iov.iov_count) { | 284 if (length == 0 || ++iovnum >= iov.iov_count) { |
285 break; | 285 break; |
286 } | 286 } |
287 src = static_cast<char*>(iov.iov[iovnum].iov_base); | 287 src = static_cast<char*>(iov.iov[iovnum].iov_base); |
288 copy_len = min(length, iov.iov[iovnum].iov_len); | 288 copy_len = min(length, iov.iov[iovnum].iov_len); |
289 } | 289 } |
290 QUIC_BUG_IF(length > 0) << "Failed to copy entire length to buffer."; | 290 QUIC_BUG_IF(length > 0) << "Failed to copy entire length to buffer."; |
291 } | 291 } |
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
717 if (bit_mask_ == 0) { | 717 if (bit_mask_ == 0) { |
718 bit_bucket_ = random_->RandUint64(); | 718 bit_bucket_ = random_->RandUint64(); |
719 bit_mask_ = 1; | 719 bit_mask_ = 1; |
720 } | 720 } |
721 bool result = ((bit_bucket_ & bit_mask_) != 0); | 721 bool result = ((bit_bucket_ & bit_mask_) != 0); |
722 bit_mask_ <<= 1; | 722 bit_mask_ <<= 1; |
723 return result; | 723 return result; |
724 } | 724 } |
725 | 725 |
726 } // namespace net | 726 } // namespace net |
OLD | NEW |