From e79055c51101ebd78400c58fa84a9a2c7513aa8c Mon Sep 17 00:00:00 2001 From: Gary Guo Date: Tue, 9 Feb 2021 06:47:38 +0000 Subject: [PATCH] Increase the threshold for using word-copy --- src/mem/impls.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mem/impls.rs b/src/mem/impls.rs index b237817d..283a918b 100644 --- a/src/mem/impls.rs +++ b/src/mem/impls.rs @@ -3,7 +3,7 @@ use core::intrinsics::likely; const WORD_SIZE: usize = core::mem::size_of::(); const WORD_MASK: usize = WORD_SIZE - 1; -const WORD_COPY_THRESHOLD: usize = 2 * WORD_SIZE; +const WORD_COPY_THRESHOLD: usize = if 2 * WORD_SIZE > 16 { 2 * WORD_SIZE } else { 16 }; #[inline(always)] unsafe fn copy_forward_bytes(mut dest: *mut u8, mut src: *const u8, n: usize) {