aboutsummaryrefslogtreecommitdiff
path: root/src/memory.rs
diff options
context:
space:
mode:
authorDavid Li <li.davidm96@gmail.com>2015-12-29 14:36:49 -0700
committerDavid Li <li.davidm96@gmail.com>2015-12-29 14:36:49 -0700
commitdcc8f7d726620e7e2c7667fcff4c134c664971d9 (patch)
treef3dee04606a007021ed21f0d5db2024143b9d881 /src/memory.rs
parent280fa4d99e3d2dfbc3e8d4f006b62e4b78538677 (diff)
Update test for new cache
Diffstat (limited to 'src/memory.rs')
-rw-r--r--src/memory.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/memory.rs b/src/memory.rs
index c3cc60a..d321711 100644
--- a/src/memory.rs
+++ b/src/memory.rs
@@ -75,7 +75,13 @@ pub struct DirectMappedCache<T: MemoryInterface> {
}
impl Memory {
- pub fn new(size: isa::Address, binary: Binary) -> Memory {
+ pub fn new(size: isa::Address) -> Memory {
+ Memory {
+ memory: vec![0; size as usize],
+ }
+ }
+
+ pub fn new_from_binary(size: isa::Address, binary: Binary) -> Memory {
let mut memory = binary.words.clone();
let size = size as usize;
if size > memory.len() {