Expand description
TODO: document alloc
module.
Re-exports§
pub use self::layout::Layout;
Modules§
- heap
- A simple heap based on a buddy allocator. For the theory of buddy allocators, see https://en.wikipedia.org/wiki/Buddy_memory_allocation or https://www.memorymanagement.org/mmref/alloc.html#buddy-system
- layout
- Implements a simple memory layout structure.
- paging
- Implements two memory allocators: a Buddy Allocator and a Best-Fit Allocator,
respectively referred to as [
BUDDY_ALLOCATOR
][crate::alloc::paging::BUDDY_ALLOCATOR] and [FIT_ALLOCATOR
][crate::alloc::paging::FIT_ALLOCATOR].
Structs§
- Allocation
Error - Global
Allocator - A global allocator for our program.
- Locked
Allocator - A simple wrapper around
spin::Mutex
to enable trait implementations.
Statics§
Traits§
Functions§
- __
rust_ allocate - Allocates a chunk of memory.
- __
rust_ deallocate - Frees a chunk of memory.
- __
rust_ reallocate - Reallocates a chunk of memory.
- __
rust_ reallocate_ inplace - We do not support in-place reallocation, so just return
oldSize
. - __
rust_ usable_ size - I have no idea what this actually does, but we’re supposed to have one, and the other backends to implement it as something equivalent to the following.
- allocate⚠
- Performs a single heap allocation, like
malloc
. Uses the size and align ofT
for the memory layout. - allocate_
array ⚠ - Allocates an array of size
size
.