Skip to content

Commit

Permalink
Increase the threshold for using word-copy
Browse files Browse the repository at this point in the history
  • Loading branch information
nbdd0121 committed Feb 9, 2021
1 parent 83b9783 commit 33bd326
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/mem/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ use core::intrinsics::likely;
const WORD_SIZE: usize = core::mem::size_of::<usize>();
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) {
Expand Down

0 comments on commit 33bd326

Please sign in to comment.