diff --git a/src/memory/bump.rs b/src/memory/bump.rs
index 16c8377..6453b10 100644
--- a/src/memory/bump.rs
+++ b/src/memory/bump.rs
@@ -1,4 +1,4 @@
-//! # Area frame allocator
+//! # Bump frame allocator
//! Some code was borrowed from [Phil Opp's Blog](http://os.phil-opp.com/allocating-frames.html)
use paging::PhysicalAddress;
@@ -15,8 +15,8 @@ pub struct BumpAllocator {
}
impl BumpAllocator {
- pub fn new(kernel_start: usize, kernel_end: usize, memory_areas: MemoryAreaIter) -> BumpAllocator {
- let mut allocator = BumpAllocator {
+ pub fn new(kernel_start: usize, kernel_end: usize, memory_areas: MemoryAreaIter) -> Self {
+ let mut allocator = Self {
next_free_frame: Frame::containing_address(PhysicalAddress::new(0)),
current_area: None,
areas: memory_areas,
@@ -43,6 +43,8 @@ impl BumpAllocator {
}
impl FrameAllocator for BumpAllocator {
+ fn set_noncore(&mut self, noncore: bool) {}
+
fn free_frames(&self) -> usize {
let mut count = 0;
diff --git a/src/memory/mod.rs b/src/memory/mod.rs
index 01216b1..fb4275b 100644
--- a/src/memory/mod.rs
+++ b/src/memory/mod.rs
@@ -4,10 +4,12 @@
pub use paging::{PAGE_SIZE, PhysicalAddress};
use self::bump::BumpAllocator;
+use self::recycle::RecycleAllocator;
use spin::Mutex;
pub mod bump;
+pub mod recycle;
/// The current memory map. It's size is maxed out to 512 entries, due to it being
/// from 0x500 to 0x5000 (800 is the absolute total)
@@ -64,7 +66,7 @@ impl Iterator for MemoryAreaIter {
}
}
-static ALLOCATOR: Mutex