Function switchboard_solana::program_id::program_memory::sol_memset
pub fn sol_memset(s: &mut [u8], c: u8, n: usize)
Expand description
Like C memset
.
§Arguments
s
- Slice to be setc
- Repeated byte to setn
- Number of bytes to set
§Errors
When executed within a SBF program, the memory region spanning n
bytes
from from the start of s
must be mapped program memory. If not, the program
will abort.
§Safety
This function is incorrectly missing an unsafe
declaration.
This function does not verify that n
is less than or equal to the length
of the s
slice passed to it — it will write bytes beyond the
slice.
Specifying an n
greater than the length of s
will likely introduce
undefined behavior.