From e353b34d4fc1b49afb4833bb7fdf70f7063b6a4d Mon Sep 17 00:00:00 2001 From: aarkegz Date: Sat, 17 Aug 2024 21:21:26 +0800 Subject: [PATCH] [wip] update `memory_addr` to new version, use git temporarily --- Cargo.toml | 4 ++++ src/area.rs | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 76649d0..8ad7a07 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" } diff --git a/src/area.rs b/src/area.rs index 5d89931..afae226 100644 --- a/src/area.rs +++ b/src/area.rs @@ -35,7 +35,7 @@ pub struct MemoryArea> { impl> MemoryArea { /// 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, @@ -65,7 +65,7 @@ impl> MemoryArea { } /// Returns the size of the memory area. - pub const fn size(&self) -> usize { + pub fn size(&self) -> usize { self.va_range.size() }