Skip to content
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

Handle range access on fragmented memory for hash and math modules. #103

Merged
merged 3 commits into from
Dec 31, 2023
Merged
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
feat: remove truncating behavior of Memory::get_contiguous
vthib committed Dec 31, 2023
commit 3206e4c5f21c6b0eab3466f9601288cbe2a0b368
4 changes: 1 addition & 3 deletions boreal/src/memory.rs
Original file line number Diff line number Diff line change
@@ -95,7 +95,6 @@ impl Memory<'_> {
if start >= mem.len() {
None
} else {
let end = std::cmp::min(mem.len(), end);
mem.get(start..end)
}
}
@@ -112,10 +111,9 @@ impl Memory<'_> {
if relative_start >= region.length {
continue;
}
let end = std::cmp::min(region.length, end - region.start);

let region = fragmented.obj.fetch(&fragmented.params)?;
return region.mem.get(relative_start..end);
return region.mem.get(relative_start..(end - region.start));
}

None