Heap bonus!
This commit is contained in:
@@ -12,6 +12,9 @@ use Result;
|
||||
use std::sync::Mutex;
|
||||
use std::rc::Rc;
|
||||
|
||||
#[cfg(feature = "bonus:heap")]
|
||||
use heap::Heap;
|
||||
|
||||
const MAGIC_HEADER:u32 = 0x1DEA_DFAD;
|
||||
const ANTI_BS_SIZE:usize = 0xFFFF;
|
||||
|
||||
@@ -23,6 +26,9 @@ pub struct Machine {
|
||||
pub frame: Vec<Frame>,
|
||||
pub net: NetStack,
|
||||
|
||||
#[cfg(feature = "bonus:heap")]
|
||||
pub heap: Heap,
|
||||
|
||||
pub stream_in: Box<Read>,
|
||||
pub stream_out: Rc<Mutex<Write>>,
|
||||
|
||||
@@ -36,9 +42,13 @@ impl Machine {
|
||||
pool,
|
||||
block,
|
||||
frame: vec![Frame::new(ANTI_BS_SIZE)],
|
||||
net: NetStack::new(),
|
||||
stream_in: Box::new(::std::io::stdin()),
|
||||
stream_out: Rc::new(Mutex::new(::std::io::stdout())),
|
||||
|
||||
net: NetStack::new(),
|
||||
|
||||
#[cfg(feature = "bonus:heap")]
|
||||
heap: Heap::new(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user