akern-gkgoat-fork/ableos/src/allocator/mod.rs

25 lines
616 B
Rust
Raw Normal View History

2021-11-27 15:19:08 +00:00
mod aalloc;
2021-11-23 11:53:06 +00:00
pub const HEAP_START: usize = 0x_4444_4444_0000;
/// 131072 bytes
pub const HEAP_MULTIPLIER: usize = 1024;
pub const HEAP_BASE: usize = 100;
pub const HEAP_SIZE: usize = HEAP_BASE * HEAP_MULTIPLIER;
// X86 alloc should be in arch/drivers/x86/alloc.rs
2021-11-28 20:50:14 +00:00
/*
2021-11-23 11:53:06 +00:00
use crate::arch::drivers::allocator::Dummy;
#[global_allocator]
static ALLOCATOR: Dummy = Dummy;
2021-11-28 20:50:14 +00:00
*/
use linked_list_allocator::LockedHeap;
#[global_allocator]
pub static ALLOCATOR: LockedHeap = LockedHeap::empty();
2021-11-23 11:53:06 +00:00
#[alloc_error_handler]
fn alloc_error_handler(layout: alloc::alloc::Layout) -> ! {
panic!("allocation error: {:?}", layout)
}