use super::tables::VARS;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub(super) enum Owner {
Var(usize),
Chunk(usize),
}
#[derive(Debug, Clone, Copy)]
pub(super) struct Region {
pub(super) addr: u32,
pub(super) layout: u16,
pub(super) count: u32,
pub(super) owner: Owner,
pub(super) off: u32,
}
impl Region {
pub(super) fn owner_desc(&self) -> String {
match self.owner {
Owner::Var(i) => VARS[i].0.to_string(),
Owner::Chunk(c) => format!("chunk {c}"),
}
}
}
pub(super) const PTRS: u16 = 0xFFFE;