Skip to content

file size limit? #237

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
loom
  • Loading branch information
cheme committed Apr 4, 2024
commit 6feb91efb8e02eb5ec950d24e9e0cd135be059e7
3 changes: 2 additions & 1 deletion src/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,10 @@ impl TableFile {

#[cfg(feature = "loom")]
pub fn slice_at(&self, offset: u64, len: usize) -> MappedBytesGuard {
let (offset, file_index) = offset_to_file_index(offset, self.max_size);
let offset = offset as usize;
let map = self.map.read();
let (map, _) = map.as_ref().unwrap();
let (map, _) = map.get(file_index).unwrap();
MappedBytesGuard::new(map[offset..offset + len].to_vec())
}

Expand Down