Function solana_program::program_memory::sol_memset
source · [−]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 BPF 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.