use thiserror::Error;
mod slot;
pub use slot::{SlotLayout, SlotPool};
#[derive(Debug, Error, Copy, Clone)]
pub enum AllocError {
#[error("Invalid free addr {0} and size {1}")]
InvalidFree(u64, usize),
#[error("Invalid argument")]
InvalidArg,
#[error("Empty region")]
EmptyRegion,
#[error("No space available")]
NoSpace,
#[error("Requested size exceeds pool capacity")]
OutOfMemory,
#[error("Failed to allocate buffer bookkeeping")]
Bookkeeping,
#[error("Overflow")]
Overflow,
}
#[derive(Debug, Clone, Copy)]
pub struct Allocation {
pub addr: u64,
pub len: u32,
}
#[cfg(test)]
mod tests;
#[cfg(test)]
mod fuzz;