Skip to main content

Module heap

Module heap 

Source
Expand description

Kernel heap allocator: a fixed-size [linked_list_allocator::LockedHeap] set as the #[global_allocator]. Does not grow after init.

Authors: MarioS271

Re-exportsยง

use crate::arch::x86_64::mm::vmm::page_type::PageType; ๐Ÿ”’
use crate::lib::addr::VirtAddr; ๐Ÿ”’
use crate::lib::panic::kernel_panic; ๐Ÿ”’
use crate::lib::panic_codes::PanicCode; ๐Ÿ”’
use crate::mm::vmm::traits::VmmPaging; ๐Ÿ”’
use crate::mm::vmm::Vmm; ๐Ÿ”’
use crate::state::kstate::KSTATE; ๐Ÿ”’
use linked_list_allocator::LockedHeap; ๐Ÿ”’
use x86_64::structures::paging::PageTableFlags; ๐Ÿ”’

Constantsยง

HEAP_BASE_ADDRESS ๐Ÿ”’
First virtual address of the heap region (higher-half kernel space).
HEAP_SIZE ๐Ÿ”’
Total heap size in bytes (4 MiB).

Staticsยง

ALLOCATOR ๐Ÿ”’
The global allocator instance; empty until init.

Functionsยง

init
Map the heap virtual address range to physical frames and initialize the allocator.