fix(interpreter): allocate stack on heap
This commit is contained in:
@@ -5,15 +5,16 @@ use super::interpreter::InterpreterError;
|
||||
/// 2*20 = 1MiB
|
||||
const MEMORY_SIZE: usize = 1048576;
|
||||
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct Memory {
|
||||
pub raw: [Byte; MEMORY_SIZE as usize],
|
||||
pub raw: Vec<Byte>,
|
||||
}
|
||||
|
||||
impl Memory {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
raw: [0; MEMORY_SIZE as usize],
|
||||
// allocating is better for such bigger objects
|
||||
raw: vec![0u8; MEMORY_SIZE],
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user