From 7d856fe0092be731ac0c957865b6c30ea75dc6cb Mon Sep 17 00:00:00 2001 From: WangRunji Date: Thu, 12 Jul 2018 19:35:21 +0800 Subject: [PATCH] Fix memory::cow LLVM error for RV32 --- crate/memory/src/cow.rs | 6 +++--- crate/memory/src/lib.rs | 2 -- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/crate/memory/src/cow.rs b/crate/memory/src/cow.rs index aa77c1d..1325d33 100644 --- a/crate/memory/src/cow.rs +++ b/crate/memory/src/cow.rs @@ -104,15 +104,15 @@ impl DerefMut for CowExt { /// A map contains reference count for shared frame #[derive(Default)] -struct FrameRcMap(BTreeMap); +struct FrameRcMap(BTreeMap); type Frame = usize; impl FrameRcMap { - fn read_count(&mut self, frame: &Frame) -> u8 { + fn read_count(&mut self, frame: &Frame) -> u16 { self.0.get(frame).unwrap_or(&(0, 0)).0 } - fn write_count(&mut self, frame: &Frame) -> u8 { + fn write_count(&mut self, frame: &Frame) -> u16 { self.0.get(frame).unwrap_or(&(0, 0)).1 } fn read_increase(&mut self, frame: &Frame) { diff --git a/crate/memory/src/lib.rs b/crate/memory/src/lib.rs index 68e0ba3..a524f07 100644 --- a/crate/memory/src/lib.rs +++ b/crate/memory/src/lib.rs @@ -11,8 +11,6 @@ extern crate alloc; extern crate std; pub mod paging; -// FIXME: LLVM error on riscv32 -#[cfg(target_arch = "x86_64")] pub mod cow; pub mod swap; pub mod memory_set;