Skip to content

Commit

Permalink
make segments! usable
Browse files Browse the repository at this point in the history
  • Loading branch information
odesenfans committed Feb 5, 2024
1 parent bd650b8 commit 398ee66
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions vm/src/vm/vm_memory/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub struct ValidationRule(
);

#[derive(Clone, Eq, Ord, PartialEq, PartialOrd, Debug)]
pub(crate) struct MemoryCell(MaybeRelocatable, bool);
pub struct MemoryCell(MaybeRelocatable, bool);

impl MemoryCell {
pub fn new(value: MaybeRelocatable) -> Self {
Expand Down Expand Up @@ -92,8 +92,8 @@ impl AddressSet {
}

pub struct Memory {
pub(crate) data: Vec<Vec<Option<MemoryCell>>>,
pub(crate) temp_data: Vec<Vec<Option<MemoryCell>>>,
pub data: Vec<Vec<Option<MemoryCell>>>,
pub temp_data: Vec<Vec<Option<MemoryCell>>>,
// relocation_rules's keys map to temp_data's indices and therefore begin at
// zero; that is, segment_index = -1 maps to key 0, -2 to key 1...
pub(crate) relocation_rules: HashMap<usize, Relocatable>,
Expand Down
2 changes: 1 addition & 1 deletion vm/src/vm/vm_memory/memory_segments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::{
pub struct MemorySegmentManager {
pub segment_sizes: HashMap<usize, usize>,
pub segment_used_sizes: Option<Vec<usize>>,
pub(crate) memory: Memory,
pub memory: Memory,
// A map from segment index to a list of pairs (offset, page_id) that constitute the
// public memory. Note that the offset is absolute (not based on the page_id).
pub public_memory_offsets: HashMap<usize, Vec<(usize, usize)>>,
Expand Down

0 comments on commit 398ee66

Please sign in to comment.