Skip to content

Revert MemorySegmentManager::memory field visibility #2158

@gabrielbosio

Description

@gabrielbosio

MemorySegmentManager::memory was changed to public in v2.0.1. This change of visibility was not necessary and it was a mistake.

Next releases (for both 2.x.y and 3.x.y) should revert MemorySegmentManager::memory visibility back to pub(crate). This will disable access of public functions implemented in Memory after making MemorySegmentManager::memory public. Next releases should include functions to keep access of the logic the mentioned public functions would not provide by reverting back the field visibility.

For example, see this function from vm/vm_memory/memory.rs:

pub fn get_maybe_relocatable(&self, key: Relocatable) -> Result<MaybeRelocatable, MemoryError> {
  // ...
}

There should be a function in vm/vm_memory/memory_segments.rs that calls the function mentioned above:

impl MemorySegmentManager {
  // ...
  pub fn get_maybe_relocatable(&self, key: Relocatable) -> Result<MaybeRelocatable, MemoryError> {
    self.memory.get_maybe_relocatable(key)
  }
  // ...
}

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions