diff --git a/src/block.rs b/src/block.rs index 92b77c3..3342ae6 100644 --- a/src/block.rs +++ b/src/block.rs @@ -59,6 +59,14 @@ impl Address { .and_then(|block| block.checked_add(self.offset)) } + pub const fn block_size(&self) -> usize { + S::SIZE + } + + pub const fn log_block_size(&self) -> u32 { + S::LOG_SIZE + } + pub fn block(&self) -> usize { self.block } diff --git a/src/lib.rs b/src/lib.rs index da79cff..c44f259 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2,6 +2,7 @@ #![feature(specialization)] #![feature(swap_with_slice)] #![feature(macro_lifetime_matcher)] +#![feature(const_fn)] #![cfg_attr(all(not(test), feature = "no_std"), no_std)] #[macro_use]