Skip to content

Commit 33bd326

Browse files
committed
Increase the threshold for using word-copy
1 parent 83b9783 commit 33bd326

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/mem/impls.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ use core::intrinsics::likely;
33
const WORD_SIZE: usize = core::mem::size_of::<usize>();
44
const WORD_MASK: usize = WORD_SIZE - 1;
55

6-
const WORD_COPY_THRESHOLD: usize = 2 * WORD_SIZE;
6+
const WORD_COPY_THRESHOLD: usize = if 2 * WORD_SIZE > 16 {
7+
2 * WORD_SIZE
8+
} else {
9+
16
10+
};
711

812
#[inline(always)]
913
unsafe fn copy_forward_bytes(mut dest: *mut u8, mut src: *const u8, n: usize) {

0 commit comments

Comments
 (0)