Make everything scale with block size and format

This commit is contained in:
Jeremy Soller
2024-02-14 10:15:26 -07:00
parent 5f00068c26
commit 4e0ab54567
11 changed files with 53 additions and 93 deletions
+3 -2
View File
@@ -2,9 +2,10 @@ use alloc::vec::Vec;
use core::{fmt, mem, ops, slice};
use simple_endian::*;
use crate::BlockPtr;
use crate::{BlockPtr, BLOCK_SIZE};
pub const ALLOC_LIST_ENTRIES: usize = 255;
pub const ALLOC_LIST_ENTRIES: usize =
(BLOCK_SIZE as usize - mem::size_of::<BlockPtr<AllocList>>()) / mem::size_of::<AllocEntry>();
#[derive(Clone, Default)]
pub struct Allocator {