Rollup merge of #121311 - Nilstrieb:is-it-overlapping, r=saethlin

Make `is_nonoverlapping` `#[inline]`

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

backlink to #120848

r? ``@saethlin``
This commit is contained in:
Nilstrieb 2024-02-20 07:35:48 +01:00 committed by GitHub
commit 9788b192bb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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();