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

Method read_64

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

Reads exactly 8 bytes at the effective address `base + offset`.

(&self, base: u64, offset: u64)

Source from the content-addressed store, hash-verified

191
192 /// Reads exactly 8 bytes at the effective address `base + offset`.
193 fn read_64(&self, base: u64, offset: u64) -> core::result::Result<[u8; 8], crate::Trap> {
194 let addr = checked_effective_addr::<8>(self.len(), base, offset)?;
195 let mut bytes = [0; 8];
196 self.read_exact(addr, &mut bytes).ok_or_else(|| {
197 cold_path();
198 memory_oob(addr, 8, self.len())
199 })?;
200 Ok(bytes)
201 }
202
203 /// Reads exactly 16 bytes at the effective address `base + offset`.
204 fn read_128(&self, base: u64, offset: u64) -> core::result::Result<[u8; 16], 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
read_exactMethod · 0.45

Tested by

no test coverage detected