mips 0.2.1

Low-level abstraction of MIPS processors
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! Traits for abstracting away frame allocation and deallocation.

use crate::addr::Frame;

/// A trait for types that can allocate a frame of memory.
pub trait FrameAllocator {
    /// Allocate a frame of the appropriate size and return it if possible.
    fn alloc(&mut self) -> Option<Frame>;
}

/// A trait for types that can deallocate a frame of memory.
pub trait FrameDeallocator {
    /// Deallocate the given frame of memory.
    fn dealloc(&mut self, frame: Frame);
}