Skip to content

Commit

Permalink
Make is_nonoverlapping #[inline]
Browse files Browse the repository at this point in the history
It showed up with 3% execution time in a compiler profile.
  • Loading branch information
Noratrieb committed Feb 19, 2024
1 parent e29a153 commit 0b59748
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions library/core/src/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2693,6 +2693,7 @@ pub(crate) fn is_valid_allocation_size(size: usize, len: usize) -> bool {

/// Checks whether the regions of memory starting at `src` and `dst` of size
/// `count * size` do *not* overlap.
#[inline]
pub(crate) fn is_nonoverlapping(src: *const (), dst: *const (), size: usize, count: usize) -> bool {
let src_usize = src.addr();
let dst_usize = dst.addr();
Expand Down

0 comments on commit 0b59748

Please sign in to comment.