Skip to content

Commit

Permalink
Rollup merge of #121311 - Nilstrieb:is-it-overlapping, r=saethlin
Browse files Browse the repository at this point in the history
Make `is_nonoverlapping` `#[inline]`

It showed up with 3% execution time in a compiler profile.

backlink to #120848

r? `@saethlin`
  • Loading branch information
saethlin authored Feb 20, 2024
2 parents e6060eb + 0b59748 commit 6544ba2
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 @@ -2733,6 +2733,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 6544ba2

Please sign in to comment.