MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / new

Method new

crates/virtual-machine/src/memory/ram.rs:15–21  ·  view source on GitHub ↗

Create RAM of `size_bytes` starting at `base`.

(base: u64, size_bytes: usize)

Source from the content-addressed store, hash-verified

13impl Ram {
14 /// Create RAM of `size_bytes` starting at `base`.
15 pub fn new(base: u64, size_bytes: usize) -> Self {
16 Self {
17 data: vec![0u8; size_bytes],
18 base,
19 size: size_bytes as u64,
20 }
21 }
22
23 pub fn contains(&self, addr: u64) -> bool {
24 addr >= self.base && addr < self.base + self.size

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected