diff --git a/Cargo.toml b/Cargo.toml index e95bee4..d11bae2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,10 +4,9 @@ version = "0.1.0" edition = "2021" [dependencies] -smallvec = { version = "1.13.2", optional = true } +smallvec = { version = "1.13.2" } [features] -default = ["reclaim-memory", "smallvec"] +default = ["reclaim-memory"] reclaim-memory = [] -smallvec = ["dep:smallvec"] timing = [] diff --git a/src/main.rs b/src/main.rs index ebd03f4..bce3d90 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,11 +1,9 @@ -#[cfg(feature = "smallvec")] use smallvec::SmallVec; use std::io::{Read, Write}; #[cfg(feature = "timing")] use std::time::Instant; use um::{Operation, Parameter, Platter}; -#[cfg(feature = "smallvec")] const SMALLVEC_SIZE: usize = 24; fn main() { @@ -51,10 +49,7 @@ impl_into_index!(Parameter); pub struct Um<'a> { program_counter: Platter, registers: [Platter; 8], - #[cfg(feature = "smallvec")] memory: Vec>, - #[cfg(not(feature = "smallvec"))] - memory: Vec>, #[cfg(feature = "reclaim-memory")] free_blocks: Vec, ops: Vec, @@ -366,13 +361,7 @@ impl<'a> Um<'a> { ) } - #[cfg(feature = "smallvec")] fn new_block(len: usize) -> SmallVec<[Platter; SMALLVEC_SIZE]> { smallvec::smallvec![0; len] } - - #[cfg(not(feature = "smallvec"))] - fn new_block(len: usize) -> Vec { - vec![0; len] - } }