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

Method read_8

crates/tinywasm/src/store/memory/paged.rs:278–283  ·  view source on GitHub ↗
(&self, base: u64, offset: u64)

Source from the content-addressed store, hash-verified

276
277 #[inline(always)]
278 fn read_8(&self, base: u64, offset: u64) -> core::result::Result<u8, crate::Trap> {
279 let addr = checked_effective_addr::<1>(self.len, base, offset)?;
280 let chunk_idx = addr >> self.chunk_shift;
281 let chunk_offset = addr & self.chunk_mask;
282 Ok(self.chunk_slice(chunk_idx).map_or(0, |chunk| chunk[chunk_offset]))
283 }
284
285 #[inline(always)]
286 fn read_16(&self, base: u64, offset: u64) -> core::result::Result<[u8; 2], crate::Trap> {

Callers

nothing calls this directly

Calls 1

chunk_sliceMethod · 0.80

Tested by

no test coverage detected