Skip to content

Commit

Permalink
workaround file cache lifetime
Browse files Browse the repository at this point in the history
  • Loading branch information
BugenZhao authored and skyzh committed Oct 28, 2022
1 parent 8772403 commit 95899b4
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/storage/src/hummock/file_cache/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ where
max_write_size: usize,

store: &'a Store<K, V>,

_phantom: PhantomData<(K, V)>,
}

impl<'a, K, V> StoreBatchWriter<'a, K, V>
Expand All @@ -84,8 +82,6 @@ where
max_write_size,

store,

_phantom: PhantomData::default(),
}
}

Expand All @@ -99,12 +95,15 @@ where
};
self.blocs.push(bloc);

let rotate_last_mut = |buffers: &'a mut Vec<_>| {
let rotate_last_mut = |buffers: &mut Vec<_>| {
buffers.push(DioBuffer::with_capacity_in(
self.buffer_capacity,
&DIO_BUFFER_ALLOCATOR,
));
buffers.last_mut().unwrap()
unsafe {
// TODO: fix this
&mut *(buffers.last_mut().unwrap() as *mut _)
}
};

let buffer = match self.buffers.last_mut() {
Expand Down

0 comments on commit 95899b4

Please sign in to comment.