pub unsafe fn sol_memcmp(s1: &[u8], s2: &[u8], n: usize) -> i32
Expand description
Like C memcmp
.
§Arguments
s1
- Slice to be compareds2
- Slice to be comparedn
- Number of bytes to compare
§Errors
When executed within a SBF program, the memory regions spanning n
bytes
from from the start of dst
and src
must be mapped program memory. If not,
the program will abort.
§Safety
It does not verify that n
is less than or equal to the lengths of the
dst
and src
slices passed to it — it will read bytes beyond the
slices.
Specifying an n
greater than either the length of dst
or src
will
likely introduce undefined behavior.