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

[WIP] update memory_addr to new version, use git reference temporarily #2

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
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
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