MCPcopy Create free account
hub / github.com/explodingcamera/tinywasm / write_32

Method write_32

crates/tinywasm/src/store/memory/mod.rs:231–237  ·  view source on GitHub ↗

Writes exactly 4 bytes at the effective address `base + offset`.

(&mut self, base: u64, offset: u64, bytes: [u8; 4])

Source from the content-addressed store, hash-verified

229
230 /// Writes exactly 4 bytes at the effective address `base + offset`.
231 fn write_32(&mut self, base: u64, offset: u64, bytes: [u8; 4]) -> core::result::Result<(), crate::Trap> {
232 let addr = checked_effective_addr::<4>(self.len(), base, offset)?;
233 self.write_all(addr, &bytes).ok_or_else(|| {
234 cold_path();
235 memory_oob(addr, 4, self.len())
236 })
237 }
238
239 /// Writes exactly 8 bytes at the effective address `base + offset`.
240 fn write_64(&mut self, base: u64, offset: u64, bytes: [u8; 8]) -> core::result::Result<(), crate::Trap> {

Callers

nothing calls this directly

Implementers 3

vec.rscrates/tinywasm/src/store/memory/vec.r
paged.rscrates/tinywasm/src/store/memory/paged
lazy.rscrates/tinywasm/src/store/memory/lazy.

Calls 3

memory_oobFunction · 0.85
lenMethod · 0.45
write_allMethod · 0.45

Tested by

no test coverage detected