2022-05-07 07:08:34 -05:00
|
|
|
//! Memory allocator
|
|
|
|
|
2022-08-20 01:27:37 -05:00
|
|
|
use log::trace;
|
2022-05-07 07:08:34 -05:00
|
|
|
|
|
|
|
///
|
|
|
|
pub const HEAP_START: usize = 0x_4444_4444_0000;
|
|
|
|
|
|
|
|
///
|
|
|
|
pub const HEAP_MULTIPLIER: usize = 100000;
|
|
|
|
|
|
|
|
///
|
|
|
|
pub const HEAP_BASE: usize = 100;
|
|
|
|
|
|
|
|
///
|
|
|
|
pub const HEAP_SIZE: usize = HEAP_BASE * HEAP_MULTIPLIER;
|
|
|
|
|
|
|
|
#[alloc_error_handler]
|
|
|
|
fn alloc_error_handler(layout: alloc::alloc::Layout) -> ! {
|
2022-08-20 01:27:37 -05:00
|
|
|
trace!("allocation error: {:?}", layout);
|
|
|
|
loop {}
|
|
|
|
// panic!("allocation error: {:?}", layout)
|
2022-05-07 07:08:34 -05:00
|
|
|
}
|