Skip to content
This repository has been archived by the owner on Sep 14, 2024. It is now read-only.

Commit

Permalink
[wip] update memory_addr to new version, use git temporarily
Browse files Browse the repository at this point in the history
  • Loading branch information
aarkegz committed Aug 17, 2024
1 parent 825f93f commit e353b34
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ categories = ["os", "memory-management", "no-std"]

[dependencies]
memory_addr = "0.2"

[patch.crates-io]
# todo: update to new version of `memory_addr` on `crates.io` once it get released
memory_addr = { git = "https://github.com/arceos-hypervisor/memory_addr.git", rev = "95f42c9" }
4 changes: 2 additions & 2 deletions src/area.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub struct MemoryArea<F: Copy, P, B: MappingBackend<F, P>> {

impl<F: Copy, P, B: MappingBackend<F, P>> MemoryArea<F, P, B> {
/// Creates a new memory area.
pub const fn new(start: VirtAddr, size: usize, flags: F, backend: B) -> Self {
pub fn new(start: VirtAddr, size: usize, flags: F, backend: B) -> Self {
Self {
va_range: VirtAddrRange::from_start_size(start, size),
flags,
Expand Down Expand Up @@ -65,7 +65,7 @@ impl<F: Copy, P, B: MappingBackend<F, P>> MemoryArea<F, P, B> {
}

/// Returns the size of the memory area.
pub const fn size(&self) -> usize {
pub fn size(&self) -> usize {
self.va_range.size()
}

Expand Down

0 comments on commit e353b34

Please sign in to comment.