Skip to content

Commit

Permalink
Add Store::with_block_size
Browse files Browse the repository at this point in the history
  • Loading branch information
hannobraun committed Nov 23, 2022
1 parent ab4d2a0 commit 1387cd9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion crates/fj-kernel/src/storage/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,13 @@ pub struct Store<T> {
impl<T> Store<T> {
/// Construct a new instance of `Store`
pub fn new() -> Self {
Self::with_block_size(BLOCK_SIZE)
}

/// Construct a new instance of `Store` using the provided block size
pub fn with_block_size(block_size: usize) -> Self {
let inner = Arc::new(RwLock::new(StoreInnerInner {
blocks: Blocks::new(BLOCK_SIZE),
blocks: Blocks::new(block_size),
}));

Self { inner }
Expand Down

0 comments on commit 1387cd9

Please sign in to comment.