Skip to main content

Module mem

Module mem 

Source
Expand description

Memory operations backed by Solana SVM syscalls.

On Solana SBF, these dispatch to sol_memcpy_, sol_memmove_, sol_memcmp_, and sol_memset_. Off-chain, they fall back to standard library implementations.

Functions§

bytes_eq
Compare two byte slices for equality using SVM-optimized memcmp.
copy_bytes
Copy bytes from one slice to another (no overlap).
memcmp⚠
Compare n bytes between two memory regions.
memcpy⚠
Copy n bytes from src to dst.
memmove⚠
Copy n bytes from src to dst, handling overlapping regions.
memset⚠
Fill n bytes starting at dst with byte.
zero_account_data
Zero-fill account data using SVM-optimized memset.
zero_fill
Zero-fill a mutable byte slice using the SVM-optimized memset.