Function is_equal_raw

unsafe fn is_equal_raw(x: *const u8, y: *const u8, n: usize) -> bool

Compare n bytes at the given pointers for equality.

This returns true if and only if *x.add(i) == *y.add(i) for all 0 <= i < n.

Inlining

This routine is marked inline(always). If you want to call this function in a way that is not always inlined, you'll need to wrap a call to it in another function that is marked as inline(never) or just inline.

Motivation

Why not use slice equality instead? Well, slice equality usually results in a call out to the current platform's libc which might not be inlineable or have other overhead. This routine isn't guaranteed to be a win, but it might be in some cases.

Safety