MCPcopy Index your code
hub / github.com/explodingcamera/tinywasm / fill

Method fill

crates/tinywasm/src/reference.rs:262–266  ·  view source on GitHub ↗

Fill a slice of memory with a value.

(&self, store: &mut Store, offset: usize, len: usize, val: u8)

Source from the content-addressed store, hash-verified

260
261 /// Fill a slice of memory with a value.
262 pub fn fill(&self, store: &mut Store, offset: usize, len: usize, val: u8) -> Result<()> {
263 self.instance_mut(store)?.inner.fill(offset, len, val).ok_or_else(|| {
264 Error::Trap(crate::Trap::MemoryOutOfBounds { offset, len, max: self.instance(store).unwrap().inner.len() })
265 })
266 }
267
268 /// Copies a full slice into memory.
269 pub fn copy_from_slice(&self, store: &mut Store, offset: usize, data: &[u8]) -> Result<()> {

Callers

nothing calls this directly

Calls 4

TrapEnum · 0.85
instance_mutMethod · 0.80
instanceMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected