1
0
forked from Rativel/BurritOS

Renamed Machine::init_machine and fixed stack overflow by allocating main_memory to the heap

This commit is contained in:
François Autin
2023-03-11 23:49:20 +01:00
parent 1f54ed35db
commit 177abfe846
4 changed files with 45 additions and 43 deletions

View File

@@ -18,7 +18,7 @@ use std::io::BufRead;
pub fn _load(path : &str, instruction_size: i32) -> Machine {
let file = fs::File::open(path).expect("Wrong filename");
let reader = io::BufReader::new(file);
let mut machine = Machine::_init_machine();
let mut machine = Machine::init_machine();
for (i,line) in reader.lines().enumerate() {
let res = u64::from_str_radix(&line.unwrap(), 16);