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

Method write_16

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

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

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

Source from the content-addressed store, hash-verified

220
221 /// Writes exactly 2 bytes at the effective address `base + offset`.
222 fn write_16(&mut self, base: u64, offset: u64, bytes: [u8; 2]) -> core::result::Result<(), crate::Trap> {
223 let addr = checked_effective_addr::<2>(self.len(), base, offset)?;
224 self.write_all(addr, &bytes).ok_or_else(|| {
225 cold_path();
226 memory_oob(addr, 2, self.len())
227 })
228 }
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> {

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