Skip to content

Commit

Permalink
Fix something
Browse files Browse the repository at this point in the history
  • Loading branch information
Golovanov399 committed Jan 16, 2025
1 parent 928ccf4 commit 5070149
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/vm/src/system/memory/offline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,11 @@ impl<F: PrimeField32> OfflineMemory<F> {
query: u32,
records: &mut Vec<AccessAdapterRecord<F>>,
) {
let lim = (self.data[(address_space - self.as_offset) as usize].memory_size()) as u32;
if query == lim {
return;
}
assert!(query < lim);
let original_block = self.block_containing(address_space, query);
if original_block.pointer == query {
return;
Expand Down
4 changes: 4 additions & 0 deletions crates/vm/src/system/memory/paged_vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ impl<T: Default + Clone, const PAGE_SIZE: usize> PagedVec<T, PAGE_SIZE> {
result
}
}

pub fn memory_size(&self) -> usize {
self.pages.len() * PAGE_SIZE
}
}

impl<T, const PAGE_SIZE: usize> PagedVec<T, PAGE_SIZE> {
Expand Down

0 comments on commit 5070149

Please sign in to comment.