mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 14:27:49 +00:00
Use our BumpAllocator instead of linked_list_allocator crate
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
use alloc::alloc::{GlobalAlloc, Layout};
|
use alloc::alloc::{GlobalAlloc, Layout};
|
||||||
|
use bump::BumpAllocator;
|
||||||
use core::ptr::null_mut;
|
use core::ptr::null_mut;
|
||||||
use linked_list_allocator::LockedHeap;
|
|
||||||
use x86_64::{
|
use x86_64::{
|
||||||
structures::paging::{
|
structures::paging::{
|
||||||
mapper::MapToError, FrameAllocator, Mapper, Page, PageTableFlags, Size4KiB,
|
mapper::MapToError, FrameAllocator, Mapper, Page, PageTableFlags, Size4KiB,
|
||||||
@@ -14,7 +14,7 @@ pub const HEAP_START: usize = 0x_4444_4444_0000;
|
|||||||
pub const HEAP_SIZE: usize = 100 * 1024; // 100 KiB
|
pub const HEAP_SIZE: usize = 100 * 1024; // 100 KiB
|
||||||
|
|
||||||
#[global_allocator]
|
#[global_allocator]
|
||||||
static ALLOCATOR: LockedHeap = LockedHeap::empty();
|
static ALLOCATOR: Locked<BumpAllocator> = Locked::new(BumpAllocator::new());
|
||||||
|
|
||||||
pub fn init_heap(
|
pub fn init_heap(
|
||||||
mapper: &mut impl Mapper<Size4KiB>,
|
mapper: &mut impl Mapper<Size4KiB>,
|
||||||
|
|||||||
Reference in New Issue
Block a user